about summary refs log tree commit diff
path: root/src/libcore/fmt
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2015-01-25 19:03:10 -0800
committerBrian Anderson <banderson@mozilla.com>2015-01-25 22:14:06 -0800
commitd179ba3b8eb65c951b68f6c52da3aba82806a3a1 (patch)
treefa8b3475117a5d145a48f200b44f75eebf9f1b9b /src/libcore/fmt
parentde5498650a4702a9552951d28f344229f37e7ae3 (diff)
parentc80e556e159af38f86eea5ee2ba796d7c724c92b (diff)
downloadrust-d179ba3b8eb65c951b68f6c52da3aba82806a3a1.tar.gz
rust-d179ba3b8eb65c951b68f6c52da3aba82806a3a1.zip
Merge remote-tracking branch 'rust-lang/master'
Conflicts:
	src/libcore/cmp.rs
	src/libcore/fmt/mod.rs
	src/libcore/iter.rs
	src/libcore/marker.rs
	src/libcore/num/f32.rs
	src/libcore/num/f64.rs
	src/libcore/result.rs
	src/libcore/str/mod.rs
	src/librustc/lint/builtin.rs
	src/librustc/lint/context.rs
	src/libstd/sync/mpsc/mod.rs
	src/libstd/sync/poison.rs
Diffstat (limited to 'src/libcore/fmt')
-rw-r--r--src/libcore/fmt/float.rs6
-rw-r--r--src/libcore/fmt/mod.rs10
-rw-r--r--src/libcore/fmt/num.rs2
3 files changed, 11 insertions, 7 deletions
diff --git a/src/libcore/fmt/float.rs b/src/libcore/fmt/float.rs
index 245dc00d838..50123499eba 100644
--- a/src/libcore/fmt/float.rs
+++ b/src/libcore/fmt/float.rs
@@ -53,7 +53,7 @@ pub enum SignFormat {
     SignNeg
 }
 
-static DIGIT_E_RADIX: uint = ('e' as uint) - ('a' as uint) + 11u;
+static DIGIT_E_RADIX: uint = ('e' as uint) - ('a' as uint) + 11;
 
 /// Converts a number to its string representation as a byte vector.
 /// This is meant to be a common base implementation for all numeric string
@@ -191,7 +191,7 @@ pub fn float_to_str_bytes_common<T: Float, U, F>(
     if deccum != _0 || (limit_digits && exact && digit_count > 0) {
         buf[end] = b'.';
         end += 1;
-        let mut dig = 0u;
+        let mut dig = 0;
 
         // calculate new digits while
         // - there is no limit and there are digits left
@@ -218,7 +218,7 @@ pub fn float_to_str_bytes_common<T: Float, U, F>(
 
             // Decrease the deccumulator one fractional digit at a time
             deccum = deccum.fract();
-            dig += 1u;
+            dig += 1;
         }
 
         // If digits are limited, and that limit has been reached,
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs
index b4e141b9bc7..577c277893c 100644
--- a/src/libcore/fmt/mod.rs
+++ b/src/libcore/fmt/mod.rs
@@ -253,6 +253,8 @@ pub trait Show {
 /// should implement this.
 #[unstable(feature = "core",
            reason = "I/O and core have yet to be reconciled")]
+#[rustc_on_unimplemented = "`{Self}` cannot be formatted using `:?`; if it is defined in your \
+                            crate, add `#[derive(Debug)]` or manually implement it"]
 pub trait Debug {
     /// Formats the value using the given formatter.
     fn fmt(&self, &mut Formatter) -> Result;
@@ -278,6 +280,8 @@ pub trait String {
 /// used. It corresponds to the default format, `{}`.
 #[unstable(feature = "core",
            reason = "I/O and core have yet to be reconciled")]
+#[rustc_on_unimplemented = "`{Self}` cannot be formatted with the default formatter; try using \
+                            `:?` instead if you are using a format string"]
 pub trait Display {
     /// Formats the value using the given formatter.
     fn fmt(&self, &mut Formatter) -> Result;
@@ -582,8 +586,8 @@ impl<'a> Formatter<'a> {
         };
 
         let (pre_pad, post_pad) = match align {
-            rt::AlignLeft => (0u, padding),
-            rt::AlignRight | rt::AlignUnknown => (padding, 0u),
+            rt::AlignLeft => (0, padding),
+            rt::AlignRight | rt::AlignUnknown => (padding, 0),
             rt::AlignCenter => (padding / 2, (padding + 1) / 2),
         };
 
@@ -873,7 +877,7 @@ macro_rules! tuple {
             fn fmt(&self, f: &mut Formatter) -> Result {
                 try!(write!(f, "("));
                 let ($(ref $name,)*) = *self;
-                let mut n = 0i;
+                let mut n = 0;
                 $(
                     if n > 0 {
                         try!(write!(f, ", "));
diff --git a/src/libcore/fmt/num.rs b/src/libcore/fmt/num.rs
index 47da8d0c419..1222126b5e0 100644
--- a/src/libcore/fmt/num.rs
+++ b/src/libcore/fmt/num.rs
@@ -147,7 +147,7 @@ pub struct RadixFmt<T, R>(T, R);
 ///
 /// ```
 /// use std::fmt::radix;
-/// assert_eq!(format!("{}", radix(55i, 36)), "1j".to_string());
+/// assert_eq!(format!("{}", radix(55, 36)), "1j".to_string());
 /// ```
 #[unstable(feature = "core",
            reason = "may be renamed or move to a different module")]