This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ../src/comp/middle/trans.rs:1382:23:1385:11: error: mismatched types: expected rec(@rec(native llbb,obj { | |
| fn AShr(native, native) -> native; | |
| fn Add(native, native) -> native; | |
| fn AddIncomingToPhi(native, &ivec[native], &ivec[native]); | |
| fn AggregateRet(&ivec[native]) -> native; | |
| fn Alloca(native) -> native; | |
| fn And(native, native) -> native; | |
| fn ArrayAlloca(native, native) -> native; | |
| fn ArrayMalloc(native, native) -> native; | |
| fn BinOp(native, native, native) -> native; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| native "rust" mod rustrt { | |
| type rust_chan; | |
| type rust_port; | |
| fn upcall_new_chan(po : *rust_port) -> *rust_chan; | |
| fn upcall_del_chan(ch : *rust_chan); | |
| fn upcall_new_port(unit_sz : uint) -> *rust_port; | |
| fn upcall_del_port(po : *rust_port); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys; | |
| export _chan; | |
| export _port; | |
| export mk_port; | |
| native "rust" mod rustrt { | |
| type rust_chan; | |
| type rust_port; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tag treemap<@K, @V> { | |
| empty; | |
| node(K, V, | |
| { | |
| mutable left : @treemap<K,V>, | |
| mutable right : @treemap<K,V> | |
| }); | |
| } | |
| fn insert<@K, @V>(m : &mutable treemap<K, V>, k : K, v : V) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (gdb) r ../src/lib/std.rc --lib | |
| The program being debugged has been started already. | |
| Start it from the beginning? (y or n) y | |
| Starting program: /Users/eholk/Documents/projects/mozilla/rust/build/stage2/rustc ../src/lib/std.rc --lib | |
| Assertion failed: (S->getType()->isPointerTy() && "Invalid cast"), function CreatePointerCast, file /Users/eholk/Documents/projects/mozilla/llvm/lib/VMCore/Instructions.cpp, line 2249. | |
| Program received signal SIGABRT, Aborted. | |
| [Switching to process 38118 thread 0x1b03] | |
| 0x96dca9c6 in __pthread_kill () | |
| (gdb) bt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tag tree_node<@K, @V> { | |
| empty; | |
| node(@K, @V, treemap<K, V>, treemap<K, V>); | |
| } | |
| type treemap<@K, @V> = @mutable tree_node<K, V>; | |
| fn init<@K, @V>() -> treemap<K,V> { @mutable empty } | |
| fn insert<@K, @V>(m : &treemap<K, V>, k : &K, v : &V) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tag tree_node<@K, @V> { empty; node(@K, @V, treemap<K, V>, treemap<K, V>); } | |
| fn foo<@K, @V>(m : @mutable tree_node<K,V>) { | |
| alt *m { | |
| empty. { none } | |
| node(@kk, @v, _, _) { | |
| ... | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std; | |
| iface vector { | |
| fn [](i: uint) -> float; | |
| fn len() -> uint; | |
| } | |
| impl vector_utils for vector { | |
| fn print() { | |
| std::io::print("[ "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let len = xs.len(); | |
| let end = uint::min(len, base + items_per_task); | |
| vec::unpack_slice::<A, ()>(xs) {|p, _len| | |
| let slice = (ptr::offset(p, base), end - base); | |
| let f = ptr::addr_of(f); | |
| futures += [future::spawn() {|copy base| | |
| unsafe { | |
| let slice : [const A]/& = | |
| unsafe::reinterpret_cast(slice); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource arc_destruct<T>(data: swappable<~arc_data<T>>) { | |
| let data = unwrap(data); | |
| let ptr = ptr::mut_addr_of((*data).count); | |
| let new_count = rustrt::rust_atomic_decrement(ptr); | |
| assert new_count >= 0; | |
| if new_count > 0 { | |
| unsafe { | |
| unsafe::forget(data); | |
| } | |
| } |