Skip to content

Instantly share code, notes, and snippets.

View jroesch's full-sized avatar

Jared Roesch jroesch

View GitHub Profile
if then else
visit_unification: r=?3 B A p
s=B
solution: ?2=fun(B : Type) => fun(A : Type) => fun(p : Prod A B) => A
solution: ?3=fun(B : Type) => fun(A : Type) => fun(p : Prod A B) => B
t: fun(B : Type) => fun(A : Type) => fun(p : Prod A B) => B B A p
u: B
pub struct Span {
pub lo: usize,
pub hi: usize,
}
trait HasSpan {
fn span_ref(&self) -> &Span;
}
enum Exp {
trait Interpreter[F[_]] {
def int(i: Int): F[Int]
def add(lhs: F[Int], rhs: F[Int]): F[Int]
}
trait Calc[A] {
def run[F[_]](interp: Interpreter[F]): F[A]
}
object Calc {
thread '<main>' has overflowed its stack
Program received signal SIGILL, Illegal instruction.
0x0000555555b3b7ae in rust_stack_exhausted ()
(gdb) bt
#0 0x0000555555b3b7ae in rust_stack_exhausted ()
#1 0x0000555555624789 in __morestack ()
#2 0x0000555555674bda in core::registry::PackageRegistry$LT$$u27$cfg$GT$.Registry::query::h5d543291b0c823751Qg ()
#3 0x0000555555664e73 in iter::_$RF$$u27$a$u20$mut$u20$I.Iterator::next::h2576205396823023654 ()
#4 0x000055555565c140 in core::resolver::Context::build_deps::hc30d3d053e688ae7KJf ()
src/test/compile-fail/default_ty_param_conflict.rs:19:13: 19:16 error: mismatched types:
expected `usize`,
found `isize` (conflicting type parameter defaults usize and isize) [E0308]
src/test/compile-fail/default_ty_param_conflict.rs:19 let x = foo();
^~~
src/test/compile-fail/default_ty_param_conflict.rs:19:13: 19:16 help: run `rustc --explain E0308` to see a detailed explanation
src/test/compile-fail/default_ty_param_conflict.rs:19:13: 19:16 note: conflicting type parameter defaults usize and isize
src/test/compile-fail/default_ty_param_conflict.rs:19 let x = foo();
^~~
src/test/compile-fail/default_ty_param_conflict.rs:1:1: 1:1 note: ...a default was defined
use std::marker::PhantomData;
trait TypeEq<A> {}
impl<A> TypeEq<A> for A {}
struct DeterministicHasher;
struct RandomHasher;
struct MyHashMap<K, V, H=DeterministicHasher> {
src/librustc_typeck/astconv.rs:1583:17: 1584:79 warning: diagnostic code E0045 already used
src/librustc_typeck/astconv.rs:1583 span_err!(tcx.sess, ast_ty.span, E0045,
src/librustc_typeck/astconv.rs:1584 "variadic function must have C calling convention");
src/librustc_typeck/check/mod.rs:682:13: 695:14 note: previous invocation
src/librustc_typeck/check/mod.rs:682 for item in &m.items {
src/librustc_typeck/check/mod.rs:683 let pty = ccx.tcx.lookup_item_type(local_def(item.id));
src/librustc_typeck/check/mod.rs:684 if !pty.generics.types.is_empty() {
src/librustc_typeck/check/mod.rs:685 span_err!(ccx.tcx.sess, item.span, E0044,
src/librustc_typeck/check/mod.rs:686 "foreign items may not have type parameters");
src/librustc_typeck/check/mod.rs:687 }
Prelude> data T = forall a. MkT a
Prelude> let x = MkT 1
Prelude> :t case x of { MkT y -> y }
<interactive>:1:22:
Couldn't match expected type ‘t’ with actual type ‘a’
because type variable ‘a’ would escape its scope
This (rigid, skolem) type variable is bound by
a pattern with constructor
MkT :: forall a. a -> T,