rust/src/test/ui/moves
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
..
issue-46099-move-in-macro.rs Fix spurious 'value moved here in previous iteration of loop' messages 2020-06-21 21:27:34 -04:00
issue-46099-move-in-macro.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
issue-75904-move-closure-loop.rs Point to a move-related span when pointing to closure upvars 2020-08-26 02:11:01 -04:00
issue-75904-move-closure-loop.stderr Point to a move-related span when pointing to closure upvars 2020-08-26 02:11:01 -04:00
move-1-unique.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
move-2-unique.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
move-2.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
move-3-unique.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
move-4-unique.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
move-4.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
move-arg-2-unique.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
move-arg-2.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
move-arg.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
move-fn-self-receiver.rs Explain move errors that occur due to method calls involving self 2020-06-26 16:28:09 -04:00
move-fn-self-receiver.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
move-guard-same-consts.rs Remove licenses 2018-12-25 21:08:33 -07:00
move-guard-same-consts.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
move-in-guard-1.rs Remove licenses 2018-12-25 21:08:33 -07:00
move-in-guard-1.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
move-in-guard-2.rs Remove licenses 2018-12-25 21:08:33 -07:00
move-in-guard-2.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
move-into-dead-array-1.rs Fixed grammar/style in error messages and reblessed tests. 2019-09-06 03:46:08 +01:00
move-into-dead-array-1.stderr Fixed grammar/style in error messages and reblessed tests. 2019-09-06 03:46:08 +01:00
move-into-dead-array-2.rs Remove licenses 2018-12-25 21:08:33 -07:00
move-into-dead-array-2.stderr update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
move-nullary-fn.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
move-out-of-array-1.rs Remove licenses 2018-12-25 21:08:33 -07:00
move-out-of-array-1.stderr Update tests for changes to cannot move errors 2019-06-03 14:55:29 +01:00
move-out-of-array-ref.rs slice_patterns: remove gates in tests 2020-01-18 19:33:47 +01:00
move-out-of-array-ref.stderr slice_patterns: remove gates in tests 2020-01-18 19:33:47 +01:00
move-out-of-field.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
move-out-of-slice-1.rs update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
move-out-of-slice-1.stderr Update tests for changes to cannot move errors 2019-06-03 14:55:29 +01:00
move-out-of-slice-2.rs move_ref_patterns: introduce tests 2020-02-02 14:13:07 +01:00
move-out-of-slice-2.stderr Add more tests for slice patterns 2019-12-21 12:29:30 +00:00
move-out-of-tuple-field.rs Remove licenses 2018-12-25 21:08:33 -07:00
move-out-of-tuple-field.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
move-scalar.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
moves-based-on-type-access-to-field.rs update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
moves-based-on-type-access-to-field.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-block-bad.rs Update tests for changes to cannot move errors 2019-06-03 14:55:29 +01:00
moves-based-on-type-block-bad.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-capture-clause-bad.rs update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
moves-based-on-type-capture-clause-bad.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-capture-clause.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
moves-based-on-type-cyclic-types-issue-4821.rs Be consistent when describing a move as a 'partial' in diagnostics 2020-08-08 14:21:04 -04:00
moves-based-on-type-cyclic-types-issue-4821.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-distribute-copy-over-paren.rs pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-distribute-copy-over-paren.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-exprs.rs update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
moves-based-on-type-exprs.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-match-bindings.rs pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-match-bindings.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-move-out-of-closure-env-issue-1965.rs Remove licenses 2018-12-25 21:08:33 -07:00
moves-based-on-type-move-out-of-closure-env-issue-1965.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-based-on-type-no-recursive-stack-closure.rs Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00
moves-based-on-type-no-recursive-stack-closure.stderr Tweak suggest_constraining_type_param 2020-03-29 13:13:17 -07:00
moves-based-on-type-tuple.rs Update tests 2019-05-03 03:11:37 -04:00
moves-based-on-type-tuple.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
moves-sru-moved-field.rs Remove licenses 2018-12-25 21:08:33 -07:00
moves-sru-moved-field.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00