Skip to content

Instantly share code, notes, and snippets.

@graue
Created May 26, 2013 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save graue/5653415 to your computer and use it in GitHub Desktop.
Save graue/5653415 to your computer and use it in GitHub Desktop.
Code using `map` that worked in Rust 0.5, but broke in 0.6
fn main() {
let s = [1, 2, 3, 4].map(|&x| (x * x).to_str());
for s.each |&item| {
io::println(item);
}
}
@graue
Copy link
Author

graue commented May 26, 2013

Result: it can't figure out which .to_str() to call out of 10(!!) candidates: i32, i16, int, u8, i64, u64, u32, uint, u16, or i8. Possibly fix by adding a type annotation, but is this a Rust bug? Kinda seems like this should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment