Skip to content

Instantly share code, notes, and snippets.

@catamorphism
catamorphism / change that triggers weird compilation error
Created March 17, 2011 18:42
change that triggers weird compilation error
diff --git a/src/boot/driver/main.ml b/src/boot/driver/main.ml
index ddcbc9a..5a5c7ce 100644
--- a/src/boot/driver/main.ml
+++ b/src/boot/driver/main.ml
@@ -35,7 +35,7 @@ let (sess:Session.sess) =
*)
Session.sess_targ = targ;
Session.sess_log_lex = false;
- Session.sess_log_parse = false;
+ Session.sess_log_parse = true;
@catamorphism
catamorphism / map
Created March 23, 2011 00:11
triggers "error: Found non-type binding for list[U]"
fn map[T, U](&list[T] ls, fn(&T t) -> U f) -> list[U] {
fn p(&T t, &list[U] u) -> &list[U] {
ret cons[U](f(t), u);
}
ret list.foldl[T, U](ls, nil, p);
}
@catamorphism
catamorphism / gist:893683
Created March 30, 2011 01:11
"make" error
compile: stage0/rustc
Fatal error: exception Not_found
Raised at file "hashtbl.ml", line 101, characters 27-36
Called from file "./src/boot/me/typestate.ml", line 471, characters 21-54
Called from file "array.ml", line 117, characters 31-48
Called from file "./src/boot/me/typestate.ml", line 494, characters 4-30
Called from file "./src/boot/me/typestate.ml", line 681, characters 12-63
Called from file "./src/boot/me/walk.ml", line 142, characters 4-9
Called from file "array.ml", line 117, characters 31-48
Called from file "./src/boot/me/walk.ml", line 143, characters 4-15
typestate: pass 2: leaving middle.typestate_check.find_pre_post_for_each_stmt
typestate: pass 2: left middle.typestate_check.find_pre_post_for_each_stmt
typestate: pass 2: entering middle.typestate_check.find_pre_post_native_mod
typestate: setting entry state as block 114526 postcondition ("entry" prestate)
typestate: setting bit 0, constraint <init #114521 = m>
typestate: done setting block postcondition
typestate: pass 2: entered middle.typestate_check.find_pre_post_native_mod
typestate: setting bit 0, constraint <init #114521 = m>
typestate: setting bit 0, constraint <init #114521 = m>
typestate: pass 2: leaving middle.typestate_check.find_pre_post_native_mod
$ VERBOSE=1 make check
cfg: building on Darwin x86_64
cfg: unix-y environment
cfg: using gcc
cfg: have ocaml native compiler
cfg: building native bootstrap compiler
cfg: disabling valgrind (CFG_DISABLE_VALGRIND)
cfg: no tex found, omitting doc/rust.pdf
cfg: using built boot/rustboot for rust deps
rt: ---
$ DYLD_LIBRARY_PATH=/Users/tjc/rust_working/rt:/Users/tjc/rust_working/rustllvm:/usr/local/lib stage0/rustc -nowarn -L stage0 -shared -o stage0/std.bc src/lib/std.rc
rt: ---
rt: f4d0:main:main: rust: src/lib/_u8.rs:14:19:14:21: warning: ignoring deprecated 'mutable' type constructor
rt: f4d0:main:main: rust: src/lib/_str.rs:147:17:147:19: warning: ignoring deprecated 'mutable' type constructor
rt: f4d0:main:main: rust: src/lib/io.rs:427:44:427:46: warning: ignoring deprecated 'mutable' type constructor
rt: f4d0:main:main: rust: src/lib/io.rs:439:36:439:38: warning: ignoring deprecated 'mutable' type constructor
rt: f4d0:main:main: rust: src/lib/io.rs:449:21:449:23: warning: ignoring deprecated 'mutable' type constructor
rt: f4d0:main:main: rust: src/lib/macos_os.rs:66:40:66:43: warning: ignoring deprecated 'mutable' type constructor
rt: f4d0:main:main: rus
rt: f4d0:main: rust_dom::free(0x109e470)
rt: f4d0:main: rust_crate_cache::flush() deref c_sym 202 (rc=1)
rt: f4d0:main: ~rust_crate_cache::c_sym(0x3b07750)
rt: f4d0:main: rust_dom::free(0x33a2500)
rt: f4d0:main: rust_crate_cache::flush() deref c_sym 207 (rc=1)
rt: f4d0:main: ~rust_crate_cache::c_sym(0x4ba7bc)
rt: f4d0:main: rust_dom::free(0x600440)
rt: f4d0:main: rust_crate_cache::flush() deref lib 0 (rc=1)
rt: f4d0:main: ~rust_crate_cache::lib(0x67d150)
fn some_vec(int x) -> vec[int] {
ret vec();
}
fn is_odd(int n) -> bool { ret true; }
fn length_is_even(vec[int] vs) -> bool {
ret true;
}
fn main() {
let int y = 42;
let int x;
x <- y;
}
/*
error message:
Assertion failed: (getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"), function AssertOK, file Instructions.cpp, line 962.
// -*- rust -*-
// error-pattern:Unsatisfied precondition
tag list { cons(int, @list); nil; }
type bubu = {x: int, y: int};
pred less_than(x: int, y: int) -> bool { ret x < y; }
type ordered_range = {low: int, high: int} : less_than(*.low, *.high);