Make utility funs in core::int, core::uint, etc. not by-reference
Closes #3302
This commit is contained in:
parent
638db28c47
commit
4128cc4cb4
23 changed files with 99 additions and 98 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue