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 S; | |
| trait A | |
| { | |
| fn test(self); | |
| } | |
| impl<'l> A for &'l S | |
| { | |
| fn test(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
| struct Location | |
| { | |
| x: f32, | |
| y: f32 | |
| } | |
| struct Velocity | |
| { | |
| vx: f32, | |
| vy: f32 |
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
| trait MyMul<RHS, Res> | |
| { | |
| fn mul(&self, rhs: &RHS) -> Res; | |
| } | |
| impl<T: ToPrimitive> MyMul<f64, f64> for T | |
| { | |
| fn mul(&self, rhs: &f64) -> f64 | |
| { | |
| self.to_f64().unwrap() * *rhs |
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
| test.rs:24:3: 24:19 error: multiple applicable methods in scope | |
| test.rs:24 self.get().sin() | |
| ^~~~~~~~~~~~~~~~ | |
| test.rs:22:2: 25:3 note: candidate #1 is `Sin$T::sin` | |
| test.rs:22 fn sin(&self) -> f32 | |
| test.rs:23 { | |
| test.rs:24 self.get().sin() | |
| test.rs:25 } | |
| test.rs:24:3: 24:19 note: candidate #2 is `std::f32::Real$f32::sin` | |
| test.rs:24 self.get().sin() |
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
| #[feature(macro_rules)]; | |
| struct Obj; | |
| impl Doer<Obj> for Obj | |
| { | |
| fn func1<'l>(&'l self) -> Result<&'l Obj, ~str> | |
| { | |
| Ok(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
| RustAlgebloat/src/vector/maps.rs:22:3: 23:3 error: multiple applicable methods in scope | |
| RustAlgebloat/src/vector/maps.rs:22 a.sin() | |
| RustAlgebloat/src/vector/maps.rs:23 } | |
| RustAlgebloat/src/vector/maps.rs:35:2: 38:3 note: candidate #1 is `vector::maps::VectorSinOp$T::sin` | |
| RustAlgebloat/src/vector/maps.rs:35 fn sin(&self) -> VectorUnOp<T, SinOp> | |
| RustAlgebloat/src/vector/maps.rs:36 { | |
| RustAlgebloat/src/vector/maps.rs:37 VectorUnOp::new(self.clone(), SinOp::new()) | |
| RustAlgebloat/src/vector/maps.rs:38 } | |
| RustAlgebloat/src/vector/maps.rs:22:3: 23:3 note: candidate #2 is `std::f32::Real$f32::sin` | |
| RustAlgebloat/src/vector/maps.rs:22 a.sin() |
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::ops::Add; | |
| use std::vec; | |
| use std::fmt; | |
| use std::io::Writer; | |
| use std::num::min; | |
| trait VectorGet | |
| { |
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::io; | |
| fn test1(adder: |add: |x: int, lw: |&mut io::Writer|||) | |
| { | |
| let mut out = io::stdout(); | |
| let w = &mut out as &mut io::Writer; | |
| let add = |x: int, lw: |&mut io::Writer|| | |
| { | |
| writeln!(w, "Location: {}", 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
| use std::num::Zero; | |
| trait VectorOf<E> | |
| { | |
| fn new() -> Self; | |
| fn get<'l>(&'l self, i: uint) -> &'l E; | |
| } | |
| impl<E> VectorOf<E> for ~[E] | |
| { |
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
| ldc2 -relocation-model=pic -c test1.d | |
| ldc2 -relocation-model=pic -c test2.d | |
| ldc2 -shared -of test.so test1.o test2.o |