rust/src/test/ui/closures
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
..
closure-expected-type Update tests 2020-05-22 18:03:08 +01:00
closure-array-break-length.rs ty: convert ErrorHandled::Reported to ConstKind::Error. 2020-04-16 19:00:30 +03:00
closure-array-break-length.stderr ty: convert ErrorHandled::Reported to ConstKind::Error. 2020-04-16 19:00:30 +03:00
closure-bounds-cant-promote-superkind-in-struct.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-bounds-cant-promote-superkind-in-struct.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
closure-bounds-static-cant-capture-borrowed.nll.stderr Change compare mode to use -Zborrowck=mir 2019-05-12 18:46:43 +01:00
closure-bounds-static-cant-capture-borrowed.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-bounds-static-cant-capture-borrowed.stderr Remove licenses 2018-12-25 21:08:33 -07:00
closure-bounds-subtype.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-bounds-subtype.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
closure-immutable-outer-variable.fixed liveness: Warn about unused captured variables 2020-05-29 17:46:38 +02:00
closure-immutable-outer-variable.rs liveness: Warn about unused captured variables 2020-05-29 17:46:38 +02:00
closure-immutable-outer-variable.rs.fixed remove remaining copyright headers 2018-12-28 21:50:33 +01:00
closure-immutable-outer-variable.stderr liveness: Warn about unused captured variables 2020-05-29 17:46:38 +02:00
closure-move-sync.rs pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
closure-move-sync.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
closure-no-fn-1.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-no-fn-1.stderr Point at type in let assignment on type errors 2019-11-21 19:24:31 -08:00
closure-no-fn-2.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-no-fn-2.stderr Point at type in let assignment on type errors 2019-11-21 19:24:31 -08:00
closure-no-fn-3.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-no-fn-3.stderr Tweak "non-primitive cast" error 2020-06-15 08:57:20 -07:00
closure-referencing-itself-issue-25954.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-referencing-itself-issue-25954.stderr Update tests 2019-03-11 23:10:26 +03:00
closure-reform-bad.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-reform-bad.stderr review comments 2020-01-08 09:29:47 -08:00
closure-wrong-kind.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-wrong-kind.stderr Update tests 2019-03-11 23:10:26 +03:00
closure_cap_coerce_many_fail.rs Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
closure_cap_coerce_many_fail.stderr Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
closure_no_cap_coerce_many_check_pass.rs Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
closure_no_cap_coerce_many_run_pass.rs Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
closure_no_cap_coerce_many_unsafe_0.rs Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
closure_no_cap_coerce_many_unsafe_0.stderr Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
closure_no_cap_coerce_many_unsafe_1.rs Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
deeply-nested_closures.rs Avoid exponential behaviour when relating types 2020-02-02 12:10:08 +00:00
diverging-closure.rs Skip tests on emscripten 2020-05-08 00:39:02 +09:00
issue-41366.rs move leak-check to during coherence, candidate eval 2020-06-22 15:33:05 +00:00
issue-41366.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
issue-46742.rs Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
issue-48109.rs Test for coercion between (FnDef | Closure) and (FnDef | Closure) 2020-05-09 11:02:31 +08:00
issue-52437.rs Update tests 2020-06-28 10:08:12 -07:00
issue-52437.stderr Update tests 2020-06-28 10:08:12 -07:00
issue-67123.rs Do not ICE on closure 2019-12-09 18:55:38 +09:00
issue-67123.stderr Tweak suggest_constraining_type_param 2020-03-29 13:13:17 -07:00
issue-68025.rs Fix ICE #68025 2020-01-20 07:06:27 +09:00