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
struct Aaa { | |
a: int, | |
} | |
fn foo() -> ~Aaa { | |
// placement new | |
~Aaa { a: 1 } | |
} | |
fn box<T>(t: T) -> ~T { ~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
use std::rt::io::stdin; | |
use std::rt::io::Reader; | |
fn main() { | |
let mut r = stdin(); | |
loop { | |
let b = r.read_byte(); | |
if b.is_none() { | |
break; | |
} |
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
#include <stdio.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
int main() { | |
for (;;) { | |
char buf[1]; | |
ssize_t r = read(STDIN_FILENO, buf, 1); | |
if (r == 0) { |
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
TRACE: None -> $(S)/library/messagebus3/test/perftest | |
TRACE: $(S)/library/messagebus3/test/perftest -> $(S)/library/execprofile | |
TRACE: $(S)/library/execprofile -> $(S)/util | |
TRACE: $(S)/util -> $(S)/util/stream | |
TRACE: $(S)/util/stream -> $(S)/contrib/libs/libbz2 | |
TRACE: $(S)/contrib/libs/libbz2 -> $(S)/contrib/libs/cxxsupp | |
TRACE: $(S)/contrib/libs/cxxsupp -> $(S)/contrib/libs/cxxsupp/libstl | |
TRACE: $(S)/contrib/libs/cxxsupp/libstl -> $(S)/contrib/libs/stlport | |
TRACE: $(S)/contrib/libs/stlport -> $(S)/contrib/libs/platform | |
TRACE: $(S)/contrib/libs/platform -> $(S)/contrib/libs/platform/mode |
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
./tmp.rs:14:27: 14:31 error: cannot infer an appropriate lifetime due to conflicting requirements | |
./tmp.rs:14 let bar: &Bar = foo as &Bar; | |
^~~~ | |
note: first, the lifetime cannot outlive lifetime re_bound(br_anon(0))... | |
./tmp.rs:15:8: 15:11 note: ...due to the following expression | |
./tmp.rs:15 baz(bar); | |
^~~ | |
./tmp.rs:13:18: 16:1 note: but, the lifetime must be valid for the block at 13:18... | |
./tmp.rs:13 fn foo(foo: &Foo) { | |
./tmp.rs:14 let bar: &Bar = foo as &Bar; |
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
diff --git a/add/add.c b/add/add.c | |
index 48f7b17..0d6370c 100644 | |
--- a/add/add.c | |
+++ b/add/add.c | |
@@ -16,6 +16,9 @@ long long microseconds() { | |
#error define USE_ATOMIC 1 or 0 | |
#endif | |
+long x = 1; | |
+long* y = &x; |
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 printer.*; | |
/// true iff type is HList | |
[Something when Type?(Something)] | |
define HList?(#Something): Bool private overload; | |
[Head, Tail when HList?(Tail)] | |
record HCons[Head, Tail]( | |
head: Head, |
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
#include <unistd.h> | |
#include <string.h> | |
template <typename T> | |
void MoveObjFromBuffer222(char* data, size_t size) { | |
char* buf = new char[size]; | |
delete[] buf; | |
getpid(); | |
getpid(); | |
getpid(); |
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
#!/bin/sh -e | |
die() { | |
echo "$@" >&2 | |
exit 1 | |
} | |
test -n "$CC" || die '$CC not set' | |
$CC -O3 -std=c99 -c ./foo.c |
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 extra; | |
use std::comm; | |
use std::io; | |
use extra::time; | |
fn to_us(ts: &time::Timespec) -> u64 { | |
ts.sec as u64 * 1000000 + ((ts.nsec / 1000) as u64) | |
} |