rust/compiler
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
..
rustc
rustc_apfloat
rustc_arena
rustc_ast Auto merge of #76170 - matklad:notrivia, r=petrochenkov 2020-09-02 03:19:38 +00:00
rustc_ast_lowering
rustc_ast_passes
rustc_ast_pretty Auto merge of #76170 - matklad:notrivia, r=petrochenkov 2020-09-02 03:19:38 +00:00
rustc_attr
rustc_builtin_macros Improve recovery on malformed format call 2020-09-02 13:18:19 +02:00
rustc_codegen_llvm pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_codegen_ssa Auto merge of #73996 - da-x:short-unique-paths, r=petrochenkov 2020-09-03 23:27:45 +00:00
rustc_data_structures Auto merge of #76233 - cuviper:unhasher, r=Mark-Simulacrum 2020-09-02 22:16:22 +00:00
rustc_driver Auto merge of #73996 - da-x:short-unique-paths, r=petrochenkov 2020-09-03 23:27:45 +00:00
rustc_error_codes Rollup merge of #76143 - jyn514:duplicate-builtin-macros, r=petrochenkov 2020-09-01 18:24:35 -07:00
rustc_errors rustc_{errors,session}: add delay_good_path_bug 2020-09-02 10:43:17 +03:00
rustc_expand Auto merge of #76170 - matklad:notrivia, r=petrochenkov 2020-09-02 03:19:38 +00:00
rustc_feature driver: replace lazy_static by SyncLazy from std 2020-09-01 22:06:47 +01:00
rustc_fs_util
rustc_graphviz
rustc_hir hir: replace lazy_static by SyncLazy from std 2020-09-01 22:06:47 +01:00
rustc_hir_pretty
rustc_incremental
rustc_index
rustc_infer Fix some unwanted uses of Debug formatting on user-facing messages 2020-09-02 10:40:10 +03:00
rustc_interface Auto merge of #73996 - da-x:short-unique-paths, r=petrochenkov 2020-09-03 23:27:45 +00:00
rustc_lexer lexer: Tiny improvement to shebang detection 2020-09-02 00:40:19 +03:00
rustc_lint rustc_lint: avoid trimmed paths for ty_find_init_error 2020-09-03 14:36:58 +03:00
rustc_macros pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_metadata
rustc_middle Auto merge of #73996 - da-x:short-unique-paths, r=petrochenkov 2020-09-03 23:27:45 +00:00
rustc_mir Auto merge of #73996 - da-x:short-unique-paths, r=petrochenkov 2020-09-03 23:27:45 +00:00
rustc_mir_build pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_parse Auto merge of #76160 - scileo:format-recovery, r=petrochenkov 2020-09-02 19:29:27 +00:00
rustc_parse_format
rustc_passes
rustc_plugin_impl
rustc_privacy
rustc_query_system
rustc_resolve Rollup merge of #76143 - jyn514:duplicate-builtin-macros, r=petrochenkov 2020-09-01 18:24:35 -07:00
rustc_save_analysis pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_serialize
rustc_session pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_span
rustc_symbol_mangling
rustc_target
rustc_trait_selection specialization_graph: avoid trimmed paths for OverlapError 2020-09-03 14:09:50 +03:00
rustc_traits
rustc_ty
rustc_typeck Fix some unwanted uses of Debug formatting on user-facing messages 2020-09-02 10:40:10 +03:00