rust/compiler/rustc_span/src
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
..
analyze_source_file
lev_distance
source_map Split span_to_string into span_to_diagnostic/embeddable_string 2021-05-11 00:04:12 +01:00
symbol
analyze_source_file.rs
caching_source_map_view.rs
crate_disambiguator.rs Revert "Merge CrateDisambiguator into StableCrateId" 2021-06-07 10:37:45 +02:00
def_id.rs Sprinkle inline. 2021-06-11 16:48:24 +02:00
edition.rs
fatal_error.rs
hygiene.rs Make DummyHashStableContext dummier. 2021-06-11 16:54:34 +02:00
lev_distance.rs
lib.rs Hash DefId in rustc_span. 2021-06-11 12:25:02 +02:00
source_map.rs Encode SourceFile source crate as StableCrateId in incr. comp. OnDiskCache. 2021-06-21 15:30:16 +02:00
span_encoding.rs
symbol.rs Auto merge of #86386 - inquisitivecrystal:better-errors-for-display-traits-v3, r=estebank 2021-06-23 03:16:04 +00:00
tests.rs