Commit Graph

12 Commits

Author SHA1 Message Date
Olivier FAURE 666afba684 Update description for error E0308
As per #76462
2020-10-25 12:20:25 +01:00
Dan Aloni 07e7823c01 pretty: trim paths of unique symbols
If a symbol name can only be imported from one place for a type, and
as long as it was not glob-imported anywhere in the current crate, we
can trim its printed path and print only the name.

This has wide implications on error messages with types, for example,
shortening `std::vec::Vec` to just `Vec`, as long as there is no other
`Vec` importable anywhere.

This adds a new '-Z trim-diagnostic-paths=false' option to control this
feature.

On the good path, with no diagnosis printed, we should try to avoid
issuing this query, so we need to prevent trimmed_def_paths query on
several cases.

This change also relies on a previous commit that differentiates
between `Debug` and `Display` on various rustc types, where the latter
is trimmed and presented to the user and the former is not.
2020-09-02 22:26:37 +03:00
DeeDeeG 57c2712895 Improve E0308 error message wording again 2020-04-21 15:06:24 -04:00
DeeDeeG 99ae42876b Improve E0308 error message wording 2020-03-21 18:12:29 -04:00
Guillaume Gomez 64460a12af Update tests 2020-03-08 11:09:48 +01:00
Esteban Küber 34f03c01f6 Point at type in `let` assignment on type errors 2019-11-21 19:24:31 -08:00
Esteban Küber 6f8f70624b Surround types with backticks in type errors 2019-11-18 11:03:04 -08:00
Esteban Küber 94c6425464 Remove E0308 note when primary label has all info 2019-11-18 11:03:03 -08:00
Esteban Küber b2e6aef073 review comments: tweak prefix strings 2019-11-18 11:02:44 -08:00
Esteban Küber 83ffda5216 Specific labels when referring to "expected" and "found" types 2019-11-18 11:02:22 -08:00
Guillaume Gomez cfd4e9722e Fix ui tests with better error code usage 2019-11-14 13:05:56 +01:00
Mikko Rantanen ff1860ad76
Fix the start/end byte positions in the compiler JSON output 2019-10-21 19:28:29 +03:00