From 20ea5fedeab3834b2b2579c11c63e8b696de49ea Mon Sep 17 00:00:00 2001 From: Aris Merchant <22333129+inquisitivecrystal@users.noreply.github.com> Date: Tue, 22 Jun 2021 00:38:31 -0700 Subject: [PATCH] Change Debug unimplemented message per request --- library/core/src/fmt/mod.rs | 2 +- .../ui/derives/derives-span-Debug-enum-struct-variant.stderr | 2 +- src/test/ui/derives/derives-span-Debug-enum.stderr | 2 +- src/test/ui/derives/derives-span-Debug-struct.stderr | 2 +- src/test/ui/derives/derives-span-Debug-tuple-struct.stderr | 2 +- src/test/ui/on-unimplemented/no-debug.stderr | 2 +- src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs index 1a65bf35897d..409a84367a7d 100644 --- a/library/core/src/fmt/mod.rs +++ b/library/core/src/fmt/mod.rs @@ -564,7 +564,7 @@ impl Display for Arguments<'_> { on( crate_local, label = "`{Self}` cannot be formatted using `{{:?}}`", - note = "add `#[derive(Debug)]` to `{Self}` or manually implement `{Debug}` for `{Self}`" + note = "add `#[derive(Debug)]` to `{Self}` or manually `impl {Debug} for {Self}`" ), message = "`{Self}` doesn't implement `{Debug}`", label = "`{Self}` cannot be formatted using `{{:?}}` because it doesn't implement `{Debug}`" diff --git a/src/test/ui/derives/derives-span-Debug-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Debug-enum-struct-variant.stderr index dc63ec7fe6f9..4ec89fe729f8 100644 --- a/src/test/ui/derives/derives-span-Debug-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-Debug-enum-struct-variant.stderr @@ -5,7 +5,7 @@ LL | x: Error | ^^^^^^^^ `Error` cannot be formatted using `{:?}` | = help: the trait `Debug` is not implemented for `Error` - = note: add `#[derive(Debug)]` to `Error` or manually implement `Debug` for `Error` + = note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error` = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Debug-enum.stderr b/src/test/ui/derives/derives-span-Debug-enum.stderr index 5a791eb6be4c..d564b6ad76b7 100644 --- a/src/test/ui/derives/derives-span-Debug-enum.stderr +++ b/src/test/ui/derives/derives-span-Debug-enum.stderr @@ -5,7 +5,7 @@ LL | Error | ^^^^^ `Error` cannot be formatted using `{:?}` | = help: the trait `Debug` is not implemented for `Error` - = note: add `#[derive(Debug)]` to `Error` or manually implement `Debug` for `Error` + = note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error` = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Debug-struct.stderr b/src/test/ui/derives/derives-span-Debug-struct.stderr index 017bddaa633f..352141c7e336 100644 --- a/src/test/ui/derives/derives-span-Debug-struct.stderr +++ b/src/test/ui/derives/derives-span-Debug-struct.stderr @@ -5,7 +5,7 @@ LL | x: Error | ^^^^^^^^ `Error` cannot be formatted using `{:?}` | = help: the trait `Debug` is not implemented for `Error` - = note: add `#[derive(Debug)]` to `Error` or manually implement `Debug` for `Error` + = note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error` = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Debug-tuple-struct.stderr b/src/test/ui/derives/derives-span-Debug-tuple-struct.stderr index 864785f2c219..65765490183b 100644 --- a/src/test/ui/derives/derives-span-Debug-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Debug-tuple-struct.stderr @@ -5,7 +5,7 @@ LL | Error | ^^^^^ `Error` cannot be formatted using `{:?}` | = help: the trait `Debug` is not implemented for `Error` - = note: add `#[derive(Debug)]` to `Error` or manually implement `Debug` for `Error` + = note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error` = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/on-unimplemented/no-debug.stderr b/src/test/ui/on-unimplemented/no-debug.stderr index 0d9544106205..b17c1d4c2520 100644 --- a/src/test/ui/on-unimplemented/no-debug.stderr +++ b/src/test/ui/on-unimplemented/no-debug.stderr @@ -5,7 +5,7 @@ LL | println!("{:?} {:?}", Foo, Bar); | ^^^ `Foo` cannot be formatted using `{:?}` | = help: the trait `Debug` is not implemented for `Foo` - = note: add `#[derive(Debug)]` to `Foo` or manually implement `Debug` for `Foo` + = note: add `#[derive(Debug)]` to `Foo` or manually `impl Debug for Foo` = note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `Bar` doesn't implement `Debug` diff --git a/src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr b/src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr index 8f9e323e9031..3cdab6541e7d 100644 --- a/src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr +++ b/src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr @@ -5,7 +5,7 @@ LL | let _: NotDebug = dbg!(NotDebug); | ^^^^^^^^^^^^^^ `NotDebug` cannot be formatted using `{:?}` | = help: the trait `Debug` is not implemented for `NotDebug` - = note: add `#[derive(Debug)]` to `NotDebug` or manually implement `Debug` for `NotDebug` + = note: add `#[derive(Debug)]` to `NotDebug` or manually `impl Debug for NotDebug` = note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error