about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorKornel <kornel@geekhood.net>2018-05-04 12:43:52 +0100
committerKornel <kornel@geekhood.net>2018-05-05 11:50:02 +0100
commit1e38eee63b0a0a3429a59dd756c852116b4d3615 (patch)
tree0389eada8159f4eb1003e31f03cf1ade19af399c /src/test
parentfc6b2c5fefa3e8793a5cab00a2d354d79137a306 (diff)
downloadrust-1e38eee63b0a0a3429a59dd756c852116b4d3615.tar.gz
rust-1e38eee63b0a0a3429a59dd756c852116b4d3615.zip
Suggest more helpful formatting string
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/on-unimplemented/no-debug.stderr11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/test/ui/on-unimplemented/no-debug.stderr b/src/test/ui/on-unimplemented/no-debug.stderr
index 5d8f80e57b0..275cd91a435 100644
--- a/src/test/ui/on-unimplemented/no-debug.stderr
+++ b/src/test/ui/on-unimplemented/no-debug.stderr
@@ -2,16 +2,17 @@ error[E0277]: `Foo` doesn't implement `std::fmt::Debug`
   --> $DIR/no-debug.rs:20:27
    |
 LL |     println!("{:?} {:?}", Foo, Bar);
-   |                           ^^^ `Foo` cannot be formatted using `:?`; add `#[derive(Debug)]` or manually implement `std::fmt::Debug`
+   |                           ^^^ `Foo` cannot be formatted using `{:?}`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `Foo`
+   = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug`
    = note: required by `std::fmt::Debug::fmt`
 
 error[E0277]: `no_debug::Bar` doesn't implement `std::fmt::Debug`
   --> $DIR/no-debug.rs:20:32
    |
 LL |     println!("{:?} {:?}", Foo, Bar);
-   |                                ^^^ `no_debug::Bar` cannot be formatted using `:?` because it doesn't implement `std::fmt::Debug`
+   |                                ^^^ `no_debug::Bar` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `no_debug::Bar`
    = note: required by `std::fmt::Debug::fmt`
@@ -20,18 +21,20 @@ error[E0277]: `Foo` doesn't implement `std::fmt::Display`
   --> $DIR/no-debug.rs:21:23
    |
 LL |     println!("{} {}", Foo, Bar);
-   |                       ^^^ `Foo` cannot be formatted with the default formatter; try using `:?` instead if you are using a format string
+   |                       ^^^ `Foo` cannot be formatted with the default formatter
    |
    = help: the trait `std::fmt::Display` is not implemented for `Foo`
+   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
    = note: required by `std::fmt::Display::fmt`
 
 error[E0277]: `no_debug::Bar` doesn't implement `std::fmt::Display`
   --> $DIR/no-debug.rs:21:28
    |
 LL |     println!("{} {}", Foo, Bar);
-   |                            ^^^ `no_debug::Bar` cannot be formatted with the default formatter; try using `:?` instead if you are using a format string
+   |                            ^^^ `no_debug::Bar` cannot be formatted with the default formatter
    |
    = help: the trait `std::fmt::Display` is not implemented for `no_debug::Bar`
+   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
    = note: required by `std::fmt::Display::fmt`
 
 error: aborting due to 4 previous errors