[struct] Lifetime: 48
[struct] Path: 104
[struct] def_id: 16
[struct] TyParam: 32
[struct] Generics: 16
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
| 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 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
| #[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 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
| execve("./test", ["./test"], [/* 54 vars */]) = 0 | |
| brk(0) = 0x6f8000 | |
| readlink("/proc/self/exe", "/home/james/tmp/test", 4096) = 20 | |
| mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb03fd5d000 | |
| access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
| open("/home/james/tmp/../../../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/tls/x86_64/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/home/james/tmp/../../../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/tls/x86_64", 0x7fff360cf100) = -1 ENOENT (No such file or directory) | |
| open("/home/james/tmp/../../../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/tls/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/home/james/tmp/../../../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/tls", 0x7fff360cf100) = -1 ENOENT (No such file or directory) | |
| open("/home/james/tmp/../../../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib |
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
| #[allow(default_methods)]; | |
| trait Foo { | |
| pub fn visit_crate(&mut self) { | |
| self.visit_mod([1,2,3]) | |
| } | |
| pub fn visit_mod(&mut self, a: &[uint]) { | |
| for a.iter().advance |i| { | |
| self.visit_item(i); |
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
| #[inline(always)] | |
| unsafe fn syscall0(n: int) -> int { | |
| let mut ret : int = 0; | |
| asm!("syscall" : "={rax}"(ret) : "{rax}"(n) : "rcx", "r11", "memory" : "volatile"); | |
| return ret; | |
| } | |
| #[inline(always)] |
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
| _ZN7rt_exit17_96fb77fd6c6361db3_00E: | |
| .cfi_startproc | |
| cmpq %fs:112, %rsp | |
| ja .LBB5_2 | |
| movabsq $8, %r10 | |
| movabsq $0, %r11 | |
| callq __morestack | |
| ret | |
| .LBB5_2: | |
| pushq %rbp |
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
| extern mod std; | |
| extern mod syntax; | |
| use syntax::ast::*; | |
| use std::sys::size_of; | |
| macro_rules! type_size ( | |
| (S $t:ident) => (print_type_size::<$t>("struct", stringify!($t))); | |
| (E $t:ident) => (print_type_size::<$t>("enum", stringify!($t))) | |
| ) |
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
| /* | |
| This is some hypothetical builder object that mutably | |
| borrows a `Map` then does stuff to it. But the map itself | |
| has a bounded lifetime. | |
| What compiles is this: | |
| */ | |
| struct Builder<'self> { |
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
| <?php | |
| /* | |
| Horrible Memory Corruption Bug. | |
| So using PHPUnit, the file below (more-or-less) gets included inside a function as bootstrapping | |
| script for PHPUnit. The first time it runs (i.e. no bytecode cache) it works fine. The second | |
| causes a segfault in release mode. It asserts if assertions are turned on (-DALWAYS_ASSERT). | |
| The assertion is: |