Skip to content

Commit b9aaa79

Browse files
committed
Remove direct chaining trait impl which may be cause of Issue 6061.
1 parent 8804b13 commit b9aaa79

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/libcore/hashmap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn resize_at(capacity: uint) -> uint {
5656
pub fn linear_map_with_capacity<K:Eq + Hash,V>(
5757
initial_capacity: uint) -> HashMap<K, V> {
5858
let r = rand::task_rng();
59-
linear_map_with_capacity_and_keys(r.gen(), r.gen(),
59+
linear_map_with_capacity_and_keys((*r).gen(), (*r).gen(),
6060
initial_capacity)
6161
}
6262

src/libcore/rand.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -688,17 +688,12 @@ pub fn task_rng() -> @IsaacRng {
688688
}
689689
}
690690

691-
// Allow direct chaining with `task_rng`
692-
impl<R: Rng> Rng for @R {
693-
fn next(&self) -> u32 { (*self).next() }
694-
}
695-
696691
/**
697692
* Returns a random value of a Rand type, using the task's random number
698693
* generator.
699694
*/
700695
pub fn random<T: Rand>() -> T {
701-
task_rng().gen()
696+
(*task_rng()).gen()
702697
}
703698

704699
#[cfg(test)]

0 commit comments

Comments
 (0)