granite-rust/compiler/rustc_mir/src
bors af3c6e733a Auto merge of - da-x:short-unique-paths, r=petrochenkov
diagnostics: shorten paths of unique symbols

This is a step towards implementing a fix for , 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  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
..
borrow_check mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
const_eval pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
dataflow mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
interpret pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
monomorphize pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
transform inliner: Avoid query cycles when optimizing generators 2020-09-02 00:00:00 +00:00
util Add new -Z dump-mir-spanview option 2020-08-31 22:57:55 -07:00
lib.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
shim.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00