rust/compiler
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
..
rustc
rustc_apfloat
rustc_arena
rustc_ast
rustc_ast_lowering
rustc_ast_passes
rustc_ast_pretty
rustc_attr
rustc_builtin_macros
rustc_codegen_llvm pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_codegen_ssa pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_data_structures
rustc_driver pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03: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 Rollup merge of #76132 - Aaron1011:mac-call-stmt, r=petrochenkov 2020-09-01 18:24:33 -07:00
rustc_feature
rustc_fs_util
rustc_graphviz
rustc_hir
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 pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_lexer lexer: Tiny improvement to shebang detection 2020-09-02 00:40:19 +03:00
rustc_lint pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_macros pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_metadata
rustc_middle pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_mir pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_mir_build pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
rustc_parse Rollup merge of #76132 - Aaron1011:mac-call-stmt, r=petrochenkov 2020-09-01 18:24:33 -07: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 pretty: trim paths of unique symbols 2020-09-02 22:26:37 +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