rust/compiler
bors 8cb207ae69 Auto merge of #86386 - inquisitivecrystal:better-errors-for-display-traits-v3, r=estebank
Better errors for Debug and Display traits

Currently, if someone tries to pass value that does not implement `Debug` or `Display` to a formatting macro, they get a very verbose and confusing error message. This PR changes the error messages for missing `Debug` and `Display` impls to be less overwhelming in this case, as suggested by #85844. I was a little less aggressive in changing the error message than that issue proposed. Still, this implementation would be enough to reduce the number of messages to be much more manageable.

After this PR, information on the cause of an error involving a `Debug` or `Display` implementation would suppressed if the requirement originated within a standard library macro. My reasoning was that errors originating from within a macro are confusing when they mention details that the programmer can't see, and this is particularly problematic for `Debug` and `Display`, which are most often used via macros. It is possible that either a broader or a narrower criterion would be better. I'm quite open to any feedback.

Fixes #85844.
2021-06-23 03:16:04 +00:00
..
rustc use jemallocator in rustc/rustdoc 2021-04-04 14:10:26 -07:00
rustc_apfloat Use the now available implementation of IntoIterator for arrays 2021-06-14 23:40:09 +02:00
rustc_arena Remove (lots of) dead code 2021-03-27 22:16:33 -04:00
rustc_ast Use AttrVec for Arm, FieldDef, and Variant 2021-06-17 08:04:54 +09:00
rustc_ast_lowering Auto merge of #86321 - JohnTitor:rollup-q61c8q4, r=JohnTitor 2021-06-15 20:15:23 +00:00
rustc_ast_passes Auto merge of #86164 - FabianWolff:issue-86053, r=davidtwco 2021-06-17 06:34:12 +00:00
rustc_ast_pretty Auto merge of #85193 - pnkfelix:readd-support-for-inner-attrs-within-match, r=nikomatsakis 2021-06-22 21:17:12 +00:00
rustc_attr remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
rustc_builtin_macros cfg_eval: Replace multiple unwraps with a single unwrap 2021-06-20 18:54:45 +03:00
rustc_codegen_cranelift Auto merge of #86291 - crlf0710:trait_vtbl_refactor, r=bjorn3 2021-06-16 07:20:27 +00:00
rustc_codegen_llvm Auto merge of #86020 - nagisa:nagisa/outliner, r=pnkfelix 2021-06-10 15:11:01 +00:00
rustc_codegen_ssa Auto merge of #86166 - tmiasko:no-alloca-for-zsts, r=nagisa 2021-06-21 04:03:51 +00:00
rustc_data_structures Rollup merge of #86387 - JohnTitor:now-no-unused-lifetimes, r=Mark-Simulacrum 2021-06-22 07:37:53 +09:00
rustc_driver Rustfmt 2021-06-04 13:20:05 +02:00
rustc_error_codes Add destructuring example of E0508 2021-06-22 22:24:46 +10:00
rustc_errors Auto merge of #85903 - bjorn3:rustc_serialize_cleanup, r=varkor 2021-06-07 14:40:26 +00:00
rustc_expand Rollup merge of #86491 - petrochenkov:derefact, r=Aaron1011 2021-06-21 09:42:19 +09:00
rustc_feature Add support for using qualified paths with structs in expression and pattern 2021-06-10 13:18:41 +02:00
rustc_fs_util
rustc_graphviz Remove (lots of) dead code 2021-03-27 22:16:33 -04:00
rustc_hir Rollup merge of #86223 - fee1-dead:better-E0121, r=petrochenkov 2021-06-23 00:20:18 +02:00
rustc_hir_pretty Remove some last remants of {push,pop}_unsafe! 2021-06-06 17:04:03 -04:00
rustc_incremental Do not require the DefPathTable to construct the on-disk cache. 2021-06-08 22:23:03 +02:00
rustc_index Remove unused feature gates 2021-05-31 13:55:43 +02:00
rustc_infer Auto merge of #86164 - FabianWolff:issue-86053, r=davidtwco 2021-06-17 06:34:12 +00:00
rustc_interface Only hash OutputTypes keys in non-crate-hash mode 2021-06-21 17:22:35 -07:00
rustc_lexer Fix outdated crate names in compiler docs 2021-04-08 11:12:14 -05:00
rustc_lint Lint for unused borrows as part of UNUSED_MUST_USE 2021-06-18 15:09:40 +08:00
rustc_lint_defs Auto merge of #85707 - jam1garner:future_prelude_collision_lint, r=nikomatsakis 2021-06-22 07:01:54 +00:00
rustc_llvm Auto merge of #84171 - ricobbe:raw-dylib-via-llvm, r=petrochenkov 2021-06-06 03:59:17 +00:00
rustc_macros Lint for unused borrows as part of UNUSED_MUST_USE 2021-06-18 15:09:40 +08:00
rustc_metadata Print more crate details in -Zls 2021-06-21 17:22:35 -07:00
rustc_middle Auto merge of #86368 - michaelwoerister:lexing-ice, r=davidtwco 2021-06-22 14:53:58 +00:00
rustc_mir Rollup merge of #86517 - camsteffen:unused-unsafe-async, r=LeSeulArtichaut 2021-06-22 20:01:05 +09:00
rustc_mir_build Rollup merge of #86517 - camsteffen:unused-unsafe-async, r=LeSeulArtichaut 2021-06-22 20:01:05 +09:00
rustc_parse Auto merge of #85193 - pnkfelix:readd-support-for-inner-attrs-within-match, r=nikomatsakis 2021-06-22 21:17:12 +00:00
rustc_parse_format remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
rustc_passes Fix ICE when using #[doc(keyword = "...")] on non-items 2021-06-17 16:45:26 +02:00
rustc_plugin_impl Use () for plugin_registrar_fn. 2021-05-12 13:58:43 +02:00
rustc_privacy Add more tests + visit_ty in some places 2021-06-09 19:28:41 +01:00
rustc_query_impl Auto merge of #85154 - cjgillot:lessfn, r=bjorn3 2021-06-15 14:52:58 +00:00
rustc_query_system Auto merge of #85154 - cjgillot:lessfn, r=bjorn3 2021-06-15 14:52:58 +00:00
rustc_resolve expand: Move some more derive logic to rustc_builtin_macros 2021-06-20 18:48:42 +03:00
rustc_save_analysis Revert "Merge CrateDisambiguator into StableCrateId" 2021-06-07 10:37:45 +02:00
rustc_serialize Emit warnings for unused fields in custom targets. 2021-06-17 21:48:02 +02:00
rustc_session Only hash OutputTypes keys in non-crate-hash mode 2021-06-21 17:22:35 -07:00
rustc_span Auto merge of #86386 - inquisitivecrystal:better-errors-for-display-traits-v3, r=estebank 2021-06-23 03:16:04 +00:00
rustc_symbol_mangling Revert "Merge CrateDisambiguator into StableCrateId" 2021-06-07 10:37:45 +02:00
rustc_target Auto merge of #85775 - adamrk:warn-unused-target-fields, r=nagisa 2021-06-21 06:56:51 +00:00
rustc_trait_selection Auto merge of #86386 - inquisitivecrystal:better-errors-for-display-traits-v3, r=estebank 2021-06-23 03:16:04 +00:00
rustc_traits Stabilize ops::ControlFlow (just the type) 2021-05-23 13:20:05 -07:00
rustc_ty_utils Revert "Merge CrateDisambiguator into StableCrateId" 2021-06-07 10:37:45 +02:00
rustc_type_ir Remove unused feature gates 2021-05-31 13:55:43 +02:00
rustc_typeck Rollup merge of #86223 - fee1-dead:better-E0121, r=petrochenkov 2021-06-23 00:20:18 +02:00