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
type circular_buf<T> = {start: uint, | |
end: uint, | |
buf: [mut T] | |
}; | |
fn make_circle<T>(s: uint, e: uint, +b: [mut T]) -> circular_buf<T> { | |
ret {start: s, end: e, buf: b }; | |
} | |
fn main() { } |
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 main() { | |
// Bitvector to represent sets of integral types | |
type int_ty_set = uint; | |
impl methods for int_ty_set { | |
fn union(s: int_ty_set) -> int_ty_set { self | s } | |
fn intersection(s: int_ty_set) -> int_ty_set { self & s } |
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
lkuper@lenny:~/rust/build$ export RUST_LOG=rustc::middle::typeck::infer=3,::rt::backtrace | |
lkuper@lenny:~/rust/build$ make check | |
cfg: shell host triple x86_64-unknown-linux-gnu | |
cfg: host for x86_64-unknown-linux-gnu is x86_64 | |
cfg: unix-y environment | |
cfg: using gcc | |
cfg: no pandoc found, omitting doc/rust.pdf | |
cfg: no llnextgen found, omitting grammar-verification | |
cfg: no pandoc found, omitting library doc build | |
cfg: including dist rules |
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
rust-try: | |
#!/bin/bash | |
git diff --quiet HEAD | |
if [[ "$?" != "0" ]]; then | |
echo "Cannot push to try with uncommitted changes." | |
exit 1 | |
fi | |
git push -f mozilla HEAD:try |
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
lkuper@lenny:~/rust/build$ make check-stage1-rpass VERBOSE=1 TESTNAME=deep-vector2 RUST_LOG=::rt::backtrace | |
cfg: shell host triple x86_64-unknown-linux-gnu | |
cfg: host for x86_64-unknown-linux-gnu is x86_64 | |
cfg: unix-y environment | |
cfg: using gcc | |
cfg: no pandoc found, omitting doc/rust.pdf | |
cfg: no llnextgen found, omitting grammar-verification | |
cfg: no pandoc found, omitting library doc build | |
cfg: including dist rules | |
cfg: including test rules |
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
iface addable { fn plus(n: int) -> int; } | |
iface subtractable { fn minus(n: int) -> int; } | |
impl of addable for int { | |
fn plus(n: int) -> int { self + n } | |
fn minus(n: int) -> int { self - n } | |
} | |
impl of subtractable for int { | |
fn minus(n: int) -> uint { self - n as uint } |
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
// Instance coherence enforcement should forbid this situation | |
mod C1 { | |
trait C1Trait { } | |
} | |
mod C2 { | |
type C2Type = int; | |
} |
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
iface from_string { | |
fn from_string(s: str) -> self; | |
} | |
impl of from_string for int { | |
fn from_string(s: str) -> int { | |
let o = int::from_str(s); | |
alt o { | |
some(i) { i } | |
none { fail; } |
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
lkuper@lenny:~/rust/build$ make check | |
cfg: shell host triple x86_64-unknown-linux-gnu | |
cfg: host for x86_64-unknown-linux-gnu is x86_64 | |
cfg: unix-y environment | |
cfg: using gcc | |
cfg: no pandoc found, omitting doc/rust.pdf | |
cfg: no llnextgen found, omitting grammar-verification | |
cfg: no pandoc found, omitting library doc build | |
cfg: including dist rules | |
cfg: including test rules |
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
lkuper@lenny:~/rust/build$ make check | |
cfg: shell host triple x86_64-unknown-linux-gnu | |
cfg: host for x86_64-unknown-linux-gnu is x86_64 | |
cfg: unix-y environment | |
cfg: using gcc | |
cfg: no pandoc found, omitting doc/rust.pdf | |
cfg: no llnextgen found, omitting grammar-verification | |
cfg: no pandoc found, omitting library doc build | |
cfg: including dist rules | |
cfg: including test rules |