diff options
| author | P1start <rewi-github@whanau.org> | 2015-01-21 11:04:17 +1300 |
|---|---|---|
| committer | P1start <rewi-github@whanau.org> | 2015-01-22 22:22:04 +1300 |
| commit | be138ed2bd6a4c4bf1c80287569709a9905e4891 (patch) | |
| tree | 39fcb029ac97f152872750b83ffd1b729b07a66f /src/libcore/fmt | |
| parent | 5d2056a7e3e52b2aec41662cfd960e0eafe8494c (diff) | |
| download | rust-be138ed2bd6a4c4bf1c80287569709a9905e4891.tar.gz rust-be138ed2bd6a4c4bf1c80287569709a9905e4891.zip | |
Add `#[rustc_on_unimplemented]` annotations to more traits
Diffstat (limited to 'src/libcore/fmt')
| -rw-r--r-- | src/libcore/fmt/mod.rs | 4 |
1 files changed, 4 insertions, 0 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; |
