Make utility funs in core::int, core::uint, etc. not by-reference

Closes #3302
This commit is contained in:
Tim Chevalier 2012-08-30 12:54:50 -07:00
parent 638db28c47
commit 4128cc4cb4
23 changed files with 99 additions and 98 deletions

View file

@ -4,7 +4,9 @@ import std::map::hashmap;
import std::map;
fn main() {
let buggy_map :hashmap<uint, &uint> = hashmap::<uint, &uint>(uint::hash, uint::eq);
let buggy_map :hashmap<uint, &uint> =
hashmap::<uint, &uint>(|x| { uint::hash(*x) },
|x, y| { uint::eq(*x, *y) });
buggy_map.insert(42, ~1); //~ ERROR illegal borrow
// but it is ok if we use a temporary