@@ -855,11 +855,13 @@ impl Display for Arguments<'_> {
855
855
#[ rustc_on_unimplemented(
856
856
on(
857
857
crate_local,
858
- label = "`{Self}` cannot be formatted using `{{:?}}`" ,
859
858
note = "add `#[derive(Debug)]` to `{Self}` or manually `impl {This} for {Self}`"
860
859
) ,
861
- message = "`{Self}` doesn't implement `{This}`" ,
862
- label = "`{Self}` cannot be formatted using `{{:?}}` because it doesn't implement `{This}`"
860
+ on(
861
+ from_desugaring = "FormatLiteral" ,
862
+ label = "`{Self}` cannot be formatted using `{{:?}}` because it doesn't implement `{This}`"
863
+ ) ,
864
+ message = "`{Self}` doesn't implement `{This}`"
863
865
) ]
864
866
#[ doc( alias = "{:?}" ) ]
865
867
#[ rustc_diagnostic_item = "Debug" ]
@@ -986,11 +988,14 @@ pub use macros::Debug;
986
988
any( Self = "std::path::Path" , Self = "std::path::PathBuf" ) ,
987
989
label = "`{Self}` cannot be formatted with the default formatter; call `.display()` on it" ,
988
990
note = "call `.display()` or `.to_string_lossy()` to safely print paths, \
989
- as they may contain non-Unicode data"
991
+ as they may contain non-Unicode data",
992
+ ) ,
993
+ on(
994
+ from_desugaring = "FormatLiteral" ,
995
+ note = "in format strings you may be able to use `{{:?}}` (or {{:#?}} for pretty-print) instead" ,
996
+ label = "`{Self}` cannot be formatted with the default formatter" ,
990
997
) ,
991
- message = "`{Self}` doesn't implement `{This}`" ,
992
- label = "`{Self}` cannot be formatted with the default formatter" ,
993
- note = "in format strings you may be able to use `{{:?}}` (or {{:#?}} for pretty-print) instead"
998
+ message = "`{Self}` doesn't implement `{This}`"
994
999
) ]
995
1000
#[ doc( alias = "{}" ) ]
996
1001
#[ rustc_diagnostic_item = "Display" ]
0 commit comments