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
macro_item_rules! int_template ( | |
($self:path) => { | |
mod $name { | |
pub pure fn min(x: $self, y: $self) -> $self { if x < y { x } else { y } } | |
} |
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
trait A: Num { | |
} | |
trait B: Num { | |
} | |
struct Foo { ... } | |
// Who implements Num? | |
impl Foo: 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
cholksey.rs: | |
``` | |
// The matrix mod is loaded from matrix/mod.rs | |
#[path = "matrix/mod.rs"] | |
mod matrix; | |
``` | |
matrix/mod.rs: |
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 { | |
f: &int | |
} | |
impl Foo { | |
fn get(&self) -> &self/int { | |
self.f | |
} | |
} |
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 Prep { | |
ctxt: &int, | |
} | |
struct Result<T> { | |
prep: Prep, | |
} | |
impl Prep { |
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
trait MyNum { | |
static fn from_int(int) -> self; | |
} | |
pub trait NumExt: MyNum {} |
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() { | |
let id: &Mat2<float> = &Matrix::identity(); | |
} | |
pub trait Index<Index,Result> { } | |
pub trait Dimensional<T>: Index<uint, T> { } | |
pub struct Mat2<T> { x: () } | |
pub struct Vec2<T> { x: () } |
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
==32705== Thread 4: | |
==32705== Conditional jump or move depends on uninitialised value(s) | |
==32705== at 0xA20ED1F: llvm::getOrEnforceKnownAlignment(llvm::Value*, unsigned int, llvm::TargetData const*) (in /home/brian/dev/rust3/build/i686-unknown-linux-gnu/stage1/lib/librustllvm.so) | |
==32705== by 0xA1A6E48: llvm::InstCombiner::visitLoadInst(llvm::LoadInst&) (in /home/brian/dev/rust3/build/i686-unknown-linux-gnu/stage1/lib/librustllvm.so) | |
==32705== by 0xA1D8DA8: llvm::InstCombiner::DoOneIteration(llvm::Function&, unsigned int) (in /home/brian/dev/rust3/build/i686-unknown-linux-gnu/stage1/lib/librustllvm.so) | |
==32705== by 0xA1D9ED5: llvm::InstCombiner::runOnFunction(llvm::Function&) (in /home/brian/dev/rust3/build/i686-unknown-linux-gnu/stage1/lib/librustllvm.so) | |
==32705== by 0xA5486B6: llvm::FPPassManager::runOnFunction(llvm::Function&) (in /home/brian/dev/rust3/build/i686-unknown-linux-gnu/stage1/lib/librustllvm.so) | |
==32705== by 0xA265778: (anonymous namespace)::CGPassManager::runOnModule(llvm::M |
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
trait MyIter<A> { | |
fn myeach(&self, f: &fn() -> bool); | |
} | |
impl<A> &[A]: MyIter<A> { | |
fn myeach(&self, f: &fn() -> bool) { } | |
} | |
fn main() { | |
for [0].myeach { } |
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
pub fn shift<T>(v: &mut ~[T]) -> T { | |
let ln = v.len(); | |
assert (ln > 0); | |
let mut vv = ~[]; | |
*v <-> vv; | |
unsafe { | |
let mut rr; | |
{ |