diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-08-08 11:38:10 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-08-27 18:47:57 -0700 |
| commit | 8693943676487c01fa09f5f3daf0df6a1f71e24d (patch) | |
| tree | 5aa978e4144d51f320d069d88fe0fad4ed40705e /src/libextra/priority_queue.rs | |
| parent | 3b6314c39bfc13b5a41c53f13c3fafa7ad91e062 (diff) | |
| download | rust-8693943676487c01fa09f5f3daf0df6a1f71e24d.tar.gz rust-8693943676487c01fa09f5f3daf0df6a1f71e24d.zip | |
librustc: Ensure that type parameters are in the right positions in paths.
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
Diffstat (limited to 'src/libextra/priority_queue.rs')
| -rw-r--r-- | src/libextra/priority_queue.rs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/libextra/priority_queue.rs b/src/libextra/priority_queue.rs index a9341a8075d..b085981aabb 100644 --- a/src/libextra/priority_queue.rs +++ b/src/libextra/priority_queue.rs @@ -338,27 +338,36 @@ mod tests { #[test] #[should_fail] - fn test_empty_pop() { let mut heap = PriorityQueue::new::<int>(); heap.pop(); } + fn test_empty_pop() { + let mut heap: PriorityQueue<int> = PriorityQueue::new(); + heap.pop(); + } #[test] fn test_empty_maybe_pop() { - let mut heap = PriorityQueue::new::<int>(); + let mut heap: PriorityQueue<int> = PriorityQueue::new(); assert!(heap.maybe_pop().is_none()); } #[test] #[should_fail] - fn test_empty_top() { let empty = PriorityQueue::new::<int>(); empty.top(); } + fn test_empty_top() { + let empty: PriorityQueue<int> = PriorityQueue::new(); + empty.top(); + } #[test] fn test_empty_maybe_top() { - let empty = PriorityQueue::new::<int>(); + let empty: PriorityQueue<int> = PriorityQueue::new(); assert!(empty.maybe_top().is_none()); } #[test] #[should_fail] - fn test_empty_replace() { let mut heap = PriorityQueue::new(); heap.replace(5); } + fn test_empty_replace() { + let mut heap: PriorityQueue<int> = PriorityQueue::new(); + heap.replace(5); + } #[test] fn test_from_iter() { |
