This file contains 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
#[allow(default_methods)]; | |
extern mod syntax; | |
use std::os; | |
use syntax::abi::AbiSet; | |
use syntax::codemap::span; | |
use syntax::parse; | |
use syntax::opt_vec; |
This file contains 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
enum opaque {} | |
trait thing { | |
pub fn foo(&self); | |
} | |
impl thing for opaque { | |
pub fn foo(&self) { | |
unsafe { | |
let o : *[int,..8] = std::cast::transmute(self); |
This file contains 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
; Function Attrs: uwtable | |
define internal fastcc void @_ZN4main16_d7d397690bb61803_00E() #1 { | |
static_allocas: | |
%tmp.i = alloca { i64, %tydesc*, {}*, {}*, { i64* } }, align 8 | |
%tmp5 = alloca i64, align 8 | |
%tmp13 = bitcast i64* %tmp5 to i8* | |
call void @llvm.lifetime.start(i64 8, i8* %tmp13) | |
store i64 543210, i64* %tmp5, align 8 | |
%0 = bitcast { i64, %tydesc*, {}*, {}*, { i64* } }* %tmp.i to i8* | |
call void @llvm.lifetime.start(i64 40, i8* %0) |
This file contains 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
#[allow(default_methods)]; | |
pub enum ParseResult<T> { | |
Err(ParseError), | |
Ok(T) | |
} | |
pub trait GenParser<T,S,A> { | |
pub fn parse<Tok:TokenStream<T>>(&mut self, &mut ParseState<Tok, S>) -> ParseResult<A>; |
This file contains 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
%struct.Foo = type { i64 } | |
define void @_ZN14__extensions__9meth_29568finalize16_d7d397690bb61803_00E({ i64, %tydesc*, i8*, i8*, i8 }*) #1 { | |
static_allocas: | |
br label %1 | |
; <label>:1 ; preds = %static_allocas | |
br label %return | |
return: ; preds = %1 |
This file contains 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
#0 0x00007ffff7886ea4 in task::spawn::spawn_raw_oldsched::make_child_wrapper::anon::expr_fn_18909 () from /home/james/projects/rust/compiler/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-6c65cf4b443341b1-0.7-pre.so | |
#1 0x00007ffff790c36c in __morestack () from /home/james/projects/rust/compiler/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-6c65cf4b443341b1-0.7-pre.so | |
#2 0x00007ffff7fc4315 in task_start_wrapper (a=0x7fffec207c80) at /home/james/projects/rust/compiler/src/rt/rust_task.cpp:166 | |
#3 0x0000000000000000 in ?? () |
This file contains 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
extern mod extra; | |
use extra::json::*; | |
/* | |
* This function manages to do absolutely no copying, which is pretty cool. | |
* | |
* "What are all those `'r`s?" you ask. Well, they're liftime parameters. They | |
* indicate how long something lasts (before it's freed). They can't change how | |
* long something lives for, they only allow you to tell the compiler stuff it |
This file contains 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
; fn f() -> ! { f() } | |
define internal fastcc void @f() #0 { | |
static_allocas: | |
tail call fastcc void @f() | |
unreachable | |
} |
This file contains 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 core::unstable::intrinsics::{init, atomic_cxchg, atomic_xchg}; | |
/** | |
* Implementation of the Chase & Lev Work-Stealing deque. | |
* | |
* This requires using owned pointers to data in order to ensure that the data is freed at the | |
* right time and place, it also allows for some of the operations to be atomic, which would not be | |
* possible if the data was bigger than a pointer. | |
* | |
* One key difference from Chase & Lev is that this implementation zeroes out the location in |
This file contains 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
struct my_c_struct { | |
f1:int, | |
f2:int | |
} | |
type MyStruct = my_c_struct; | |
impl Drop for MyStruct { | |
fn finalize(&self) { | |
unsafe { |