rust/src/test/ui/unsized-locals
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 Add tests for unsized-locals functions stability. 2018-11-21 22:20:22 +09:00
autoderef.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
borrow-after-move.rs update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
borrow-after-move.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
box-fnonce.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
by-value-trait-object-safety-rpass.rs tests: Move run-pass tests with naming conflicts to ui 2019-07-27 18:56:17 +03:00
by-value-trait-object-safety-withdefault.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
by-value-trait-object-safety.rs
by-value-trait-object-safety.stderr Point at Sized requirements 2020-02-02 11:53:10 -08:00
double-move.rs Add more tests on unsized locals autoderef and borrowck. 2018-10-27 17:17:24 +09:00
double-move.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
issue-30276-feature-flagged.rs Test for zero-sized function items not ICEing 2020-04-30 16:02:37 -07:00
issue-30276-feature-flagged.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
issue-30276.rs Test for zero-sized function items not ICEing 2020-04-30 16:02:37 -07:00
issue-30276.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
issue-50940-with-feature.rs Add tests verifying #50940. 2018-11-21 22:20:22 +09:00
issue-50940-with-feature.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
issue-50940.rs Add tests verifying #50940. 2018-11-21 22:20:22 +09:00
issue-50940.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
reference-unsized-locals.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
simple-unsized-locals.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
unsized-exprs-rpass.rs update tests 2020-03-31 19:01:49 +02:00
unsized-exprs.rs Check arg/ret sizedness at ExprKind::Path. 2018-11-21 22:20:22 +09:00
unsized-exprs.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
unsized-exprs2.rs update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
unsized-exprs2.stderr Make Box<dyn FnOnce> respect self alignment 2020-04-18 14:37:44 -03:00
unsized-exprs3.rs Add tests for unsized-locals functions stability. 2018-11-21 22:20:22 +09:00
unsized-exprs3.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
unsized-index.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
unsized-parameters.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00