about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlavio Percoco Premoli <flaper87@gmail.com>2015-01-24 10:42:40 +0100
committerFlavio Percoco Premoli <flaper87@gmail.com>2015-01-24 10:42:40 +0100
commit6a9ee09a991fcc909a66df4009658481f8a94071 (patch)
tree3c9e66211057167c49689b77e18da0c220b23f98
parentd19f28b2f238e051a80caa4af6e4c5ec89ad6909 (diff)
parent87db16cecd165ab8ed57dfa308a429868716fdc9 (diff)
downloadrust-6a9ee09a991fcc909a66df4009658481f8a94071.tar.gz
rust-6a9ee09a991fcc909a66df4009658481f8a94071.zip
Rollup merge of #21445 - P1start:no-implemented, r=nikomatsakis
-rw-r--r--src/libcore/fmt/mod.rs4
-rw-r--r--src/libcore/iter.rs2
-rw-r--r--src/libcore/marker.rs9
3 files changed, 12 insertions, 3 deletions
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs
index 0e8d31a62ee..60403d1c011 100644
--- a/src/libcore/fmt/mod.rs
+++ b/src/libcore/fmt/mod.rs
@@ -243,6 +243,8 @@ pub trait Show {
 /// Format trait for the `:?` format. Useful for debugging, most all types
 /// should implement this.
 #[unstable = "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;
@@ -266,6 +268,8 @@ pub trait String {
 /// When a value can be semantically expressed as a String, this trait may be
 /// used. It corresponds to the default format, `{}`.
 #[unstable = "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;
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index 2673cf1af78..ce872db0299 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -82,6 +82,8 @@ use usize;
 /// else.
 #[lang="iterator"]
 #[stable]
+#[rustc_on_unimplemented = "`{Self}` is not an iterator; maybe try calling `.iter()` or a similar \
+                            method"]
 pub trait Iterator {
     #[stable]
     type Item;
diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs
index a987a0a5068..688f0484401 100644
--- a/src/libcore/marker.rs
+++ b/src/libcore/marker.rs
@@ -27,9 +27,10 @@
 
 use clone::Clone;
 
-/// Types able to be transferred across task boundaries.
+/// Types able to be transferred across thread boundaries.
 #[unstable = "will be overhauled with new lifetime rules; see RFC 458"]
 #[lang="send"]
+#[rustc_on_unimplemented = "`{Self}` cannot be sent between threads safely"]
 pub unsafe trait Send: 'static {
     // empty.
 }
@@ -37,6 +38,7 @@ pub unsafe trait Send: 'static {
 /// Types with a constant size known at compile-time.
 #[stable]
 #[lang="sized"]
+#[rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time"]
 pub trait Sized {
     // Empty.
 }
@@ -146,11 +148,11 @@ pub trait Copy {
     // Empty.
 }
 
-/// Types that can be safely shared between tasks when aliased.
+/// Types that can be safely shared between threads when aliased.
 ///
 /// The precise definition is: a type `T` is `Sync` if `&T` is
 /// thread-safe. In other words, there is no possibility of data races
-/// when passing `&T` references between tasks.
+/// when passing `&T` references between threads.
 ///
 /// As one would expect, primitive types like `u8` and `f64` are all
 /// `Sync`, and so are simple aggregate types containing them (like
@@ -193,6 +195,7 @@ pub trait Copy {
 /// `transmute`-ing from `&T` to `&mut T` is illegal).
 #[unstable = "will be overhauled with new lifetime rules; see RFC 458"]
 #[lang="sync"]
+#[rustc_on_unimplemented = "`{Self}` cannot be shared between threads safely"]
 pub unsafe trait Sync {
     // Empty
 }