Skip to content

Instantly share code, notes, and snippets.

@iamtakingiteasy
Created July 16, 2012 14:10
Show Gist options
  • Save iamtakingiteasy/3122924 to your computer and use it in GitHub Desktop.
Save iamtakingiteasy/3122924 to your computer and use it in GitHub Desktop.
import io::*;
import to_str::*;
impl <T : to_str copy> of to_str for @[mut T] {
fn to_str() -> str {
let tmp = self;
tmp.map(|x| { x.to_str() }).to_str()
}
}
fn main() {
println((@[mut 1, 2, 3]).to_str());
}
user@note ~/soft/mine/rust $ rustc example.rs
example.rs:7:8: 7:11 error: internal compiler error: aliased ptr with a non-none lp
example.rs:7 tmp.map(|x| { x.to_str() }).to_str()
^~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment