Skip to content

Instantly share code, notes, and snippets.

@alexcrichton
Last active December 17, 2015 01:48
Show Gist options
  • Save alexcrichton/5530606 to your computer and use it in GitHub Desktop.
Save alexcrichton/5530606 to your computer and use it in GitHub Desktop.
/Users/alex/code/rust2/src/libcore/task/spawn.rs:105:26: 105:45 error: multiple applicable methods in scope
/Users/alex/code/rust2/src/libcore/task/spawn.rs:105 let didnt_overwrite = tasks.insert(task);
^~~~~~~~~~~~~~~~~~~
/Users/alex/code/rust2/src/libcore/container.rs:74:4: 76:5 note: candidate #1 is `container::__extensions__::insert`
/Users/alex/code/rust2/src/libcore/container.rs:74 fn insert(&mut self, key: K, value: V) -> bool {
/Users/alex/code/rust2/src/libcore/container.rs:75 self.swap(key, value).is_none()
/Users/alex/code/rust2/src/libcore/container.rs:76 }
/Users/alex/code/rust2/src/libcore/hashmap.rs:562:4: 562:73 note: candidate #2 is `hashmap::__extensions__::insert`
/Users/alex/code/rust2/src/libcore/hashmap.rs:562 fn insert(&mut self, value: T) -> bool { self.map.insert(value, ()) }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
type TaskSet = HashSet<*rust_task>;
fn taskset_insert(tasks: &mut TaskSet, task: *rust_task) {
let didnt_overwrite = tasks.insert(task);
assert!(didnt_overwrite);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment