rust/src/test/ui/on-unimplemented
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
..
auxiliary Remove unnecessary ignore-tidy-linelength 2019-04-23 11:42:14 +01:00
bad-annotation.rs gate rustc_on_unimplemented under rustc_attrs 2019-11-06 07:34:51 +01:00
bad-annotation.stderr Increase spacing for suggestions in diagnostics 2019-10-24 12:26:01 -07:00
enclosing-scope.rs add enclosing_scope param to rustc_on_unimplmented 2019-11-25 18:05:56 +03:00
enclosing-scope.stderr Small tweaks to required bound span 2020-04-08 14:40:51 -07:00
expected-comma-found-token.rs parse_meta: ditch parse_in_attr 2019-12-06 21:17:18 +01:00
expected-comma-found-token.stderr parse_meta: ditch parse_in_attr 2019-12-06 21:17:18 +01:00
feature-gate-on-unimplemented.rs gate rustc_on_unimplemented under rustc_attrs 2019-11-06 07:34:51 +01:00
feature-gate-on-unimplemented.stderr Make rustc_attrs tracking issue None 2020-03-01 00:48:14 +09:00
multiple-impls.rs gate rustc_on_unimplemented under rustc_attrs 2019-11-06 07:34:51 +01:00
multiple-impls.stderr When possible point at argument causing item obligation failure 2019-09-19 12:10:23 -07:00
no-debug.rs pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
no-debug.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
on-impl.rs gate rustc_on_unimplemented under rustc_attrs 2019-11-06 07:34:51 +01:00
on-impl.stderr When possible point at argument causing item obligation failure 2019-09-19 12:10:23 -07:00
on-trait.rs gate rustc_on_unimplemented under rustc_attrs 2019-11-06 07:34:51 +01:00
on-trait.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
slice-index.rs Remove unnecessary ignore-tidy-linelength 2019-04-23 11:42:14 +01:00
slice-index.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00