about summary refs log tree commit diff
path: root/src/libstd/io/timer.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/libstd/io/timer.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/libstd/io/timer.rs')
-rw-r--r--src/libstd/io/timer.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/io/timer.rs b/src/libstd/io/timer.rs
index da099953a49..9ae855536ac 100644
--- a/src/libstd/io/timer.rs
+++ b/src/libstd/io/timer.rs
@@ -115,7 +115,7 @@ impl Timer {
     /// let mut timer = Timer::new().unwrap();
     /// let ten_milliseconds = timer.oneshot(10);
     ///
-    /// for _ in range(0, 100) { /* do work */ }
+    /// for _ in range(0u, 100) { /* do work */ }
     ///
     /// // blocks until 10 ms after the `oneshot` call
     /// ten_milliseconds.recv();
@@ -157,12 +157,12 @@ impl Timer {
     /// let mut timer = Timer::new().unwrap();
     /// let ten_milliseconds = timer.periodic(10);
     ///
-    /// for _ in range(0, 100) { /* do work */ }
+    /// for _ in range(0u, 100) { /* do work */ }
     ///
     /// // blocks until 10 ms after the `periodic` call
     /// ten_milliseconds.recv();
     ///
-    /// for _ in range(0, 100) { /* do work */ }
+    /// for _ in range(0u, 100) { /* do work */ }
     ///
     /// // blocks until 20 ms after the `periodic` call (*not* 10ms after the
     /// // previous `recv`)