rust/src/test/ui/codemap_tests
bors af3c6e733a Auto merge of #73996 - da-x:short-unique-paths, r=petrochenkov
diagnostics: shorten paths of unique symbols

This is a step towards implementing a fix for #50310, and continuation of the discussion in [Pre-RFC: Nicer Types In Diagnostics - compiler - Rust Internals](https://internals.rust-lang.org/t/pre-rfc-nicer-types-in-diagnostics/11139). Impressed upon me from previous discussion in #21934 that an RFC for this is not needed, and I should just come up with code.

The recent improvements to `use` suggestions that I've contributed have given rise to this implementation. Contrary to previous suggestions, it's rather simple logic, and I believe it only reduces the amount of cognitive load that a developer would need when reading type errors.

-----

If a symbol name can only be imported from one place, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path to the last component.

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 from anywhere.
2020-09-03 23:27:45 +00:00
..
bad-format-args.rs Improve recovery on malformed format call 2020-09-02 13:18:19 +02:00
bad-format-args.stderr Improve recovery on malformed format call 2020-09-02 13:18:19 +02:00
coherence-overlapping-inherent-impl-trait.rs Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00
coherence-overlapping-inherent-impl-trait.stderr Use smaller def span for functions 2020-08-22 18:41:49 -04:00
empty_span.rs introduce negative_impls feature gate and document 2020-03-26 06:52:55 -04:00
empty_span.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
huge_multispan_highlight.rs Remove licenses 2018-12-25 21:08:33 -07:00
huge_multispan_highlight.stderr update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
issue-11715.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-11715.stderr update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
issue-28308.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-28308.stderr rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
one_line.rs Remove licenses 2018-12-25 21:08:33 -07:00
one_line.stderr update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
overlapping_inherent_impls.rs Remove licenses 2018-12-25 21:08:33 -07:00
overlapping_inherent_impls.stderr Use smaller def span for functions 2020-08-22 18:41:49 -04:00
tab.rs Remove licenses 2018-12-25 21:08:33 -07:00
tab.stderr Surround types with backticks in type errors 2019-11-18 11:03:04 -08:00
tab_2.rs Remove licenses 2018-12-25 21:08:33 -07:00
tab_2.stderr Update UI tests 2020-06-21 16:40:36 +02:00
tab_3.rs update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
tab_3.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
two_files.rs Remove licenses 2018-12-25 21:08:33 -07:00
two_files.stderr Tweak some suggestions in rustc_resolve 2020-04-26 11:43:43 -07:00
two_files_data.rs Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00
unicode.rs Remove licenses 2018-12-25 21:08:33 -07:00
unicode.stderr [AVR] Add required references for AVR to the parser test suites 2020-06-09 17:35:48 +12:00
unicode_2.rs Remove licenses 2018-12-25 21:08:33 -07:00
unicode_2.stderr Add a test and bless existing test case. 2019-12-26 13:13:01 +08:00
unicode_3.rs Moving more build-pass tests to check-pass 2020-04-23 20:21:38 -07:00
unicode_3.stderr rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00