about summary refs log tree commit diff
path: root/src/libcollections/priority_queue.rs
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2014-04-21 17:58:52 -0400
committerAlex Crichton <alex@alexcrichton.com>2014-06-24 17:18:48 -0700
commit9e3d0b002a5c2e81d43351c9b8550a3f4ccfb8f9 (patch)
tree1e9a15e8a55cc3947025ab3ac044c2f7977159d9 /src/libcollections/priority_queue.rs
parentf7f95c8f5a6294f161800dbb65a0423bb5248f34 (diff)
downloadrust-9e3d0b002a5c2e81d43351c9b8550a3f4ccfb8f9.tar.gz
rust-9e3d0b002a5c2e81d43351c9b8550a3f4ccfb8f9.zip
librustc: Remove the fallback to `int` from typechecking.
This breaks a fair amount of code. The typical patterns are:

* `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`;

* `println!("{}", 3)`: change to `println!("{}", 3i)`;

* `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`.

RFC #30. Closes #6023.

[breaking-change]
Diffstat (limited to 'src/libcollections/priority_queue.rs')
-rw-r--r--src/libcollections/priority_queue.rs36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/libcollections/priority_queue.rs b/src/libcollections/priority_queue.rs
index f25864933f2..256621d08e5 100644
--- a/src/libcollections/priority_queue.rs
+++ b/src/libcollections/priority_queue.rs
@@ -255,8 +255,8 @@ mod tests {
 
     #[test]
     fn test_iterator() {
-        let data = vec!(5, 9, 3);
-        let iterout = [9, 5, 3];
+        let data = vec!(5i, 9, 3);
+        let iterout = [9i, 5, 3];
         let pq = PriorityQueue::from_vec(data);
         let mut i = 0;
         for el in pq.iter() {
@@ -279,7 +279,7 @@ mod tests {
 
     #[test]
     fn test_push() {
-        let mut heap = PriorityQueue::from_vec(vec!(2, 4, 9));
+        let mut heap = PriorityQueue::from_vec(vec!(2i, 4, 9));
         assert_eq!(heap.len(), 3);
         assert!(*heap.top().unwrap() == 9);
         heap.push(11);
@@ -301,7 +301,7 @@ mod tests {
 
     #[test]
     fn test_push_unique() {
-        let mut heap = PriorityQueue::from_vec(vec!(box 2, box 4, box 9));
+        let mut heap = PriorityQueue::from_vec(vec!(box 2i, box 4, box 9));
         assert_eq!(heap.len(), 3);
         assert!(*heap.top().unwrap() == box 9);
         heap.push(box 11);
@@ -323,7 +323,7 @@ mod tests {
 
     #[test]
     fn test_push_pop() {
-        let mut heap = PriorityQueue::from_vec(vec!(5, 5, 2, 1, 3));
+        let mut heap = PriorityQueue::from_vec(vec!(5i, 5, 2, 1, 3));
         assert_eq!(heap.len(), 5);
         assert_eq!(heap.push_pop(6), 6);
         assert_eq!(heap.len(), 5);
@@ -337,7 +337,7 @@ mod tests {
 
     #[test]
     fn test_replace() {
-        let mut heap = PriorityQueue::from_vec(vec!(5, 5, 2, 1, 3));
+        let mut heap = PriorityQueue::from_vec(vec!(5i, 5, 2, 1, 3));
         assert_eq!(heap.len(), 5);
         assert_eq!(heap.replace(6).unwrap(), 5);
         assert_eq!(heap.len(), 5);
@@ -362,18 +362,18 @@ mod tests {
     #[test]
     fn test_to_vec() {
         check_to_vec(vec!());
-        check_to_vec(vec!(5));
-        check_to_vec(vec!(3, 2));
-        check_to_vec(vec!(2, 3));
-        check_to_vec(vec!(5, 1, 2));
-        check_to_vec(vec!(1, 100, 2, 3));
-        check_to_vec(vec!(1, 3, 5, 7, 9, 2, 4, 6, 8, 0));
-        check_to_vec(vec!(2, 4, 6, 2, 1, 8, 10, 3, 5, 7, 0, 9, 1));
-        check_to_vec(vec!(9, 11, 9, 9, 9, 9, 11, 2, 3, 4, 11, 9, 0, 0, 0, 0));
-        check_to_vec(vec!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
-        check_to_vec(vec!(10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0));
-        check_to_vec(vec!(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 1, 2));
-        check_to_vec(vec!(5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1));
+        check_to_vec(vec!(5i));
+        check_to_vec(vec!(3i, 2));
+        check_to_vec(vec!(2i, 3));
+        check_to_vec(vec!(5i, 1, 2));
+        check_to_vec(vec!(1i, 100, 2, 3));
+        check_to_vec(vec!(1i, 3, 5, 7, 9, 2, 4, 6, 8, 0));
+        check_to_vec(vec!(2i, 4, 6, 2, 1, 8, 10, 3, 5, 7, 0, 9, 1));
+        check_to_vec(vec!(9i, 11, 9, 9, 9, 9, 11, 2, 3, 4, 11, 9, 0, 0, 0, 0));
+        check_to_vec(vec!(0i, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+        check_to_vec(vec!(10i, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0));
+        check_to_vec(vec!(0i, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 1, 2));
+        check_to_vec(vec!(5i, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1));
     }
 
     #[test]