/// 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;
/// 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;
/// Types able to be transferred across task 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.
}
/// 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.
}
/// `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
}