rust/src/test/pretty
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 licenses 2018-12-25 21:08:33 -07:00
asm.pp asm: Allow multiple template strings; interpret them as newline-separated 2020-06-15 12:35:27 -07:00
asm.rs asm: Allow multiple template strings; interpret them as newline-separated 2020-06-15 12:35:27 -07:00
ast-stmt-expr-attr.rs ast_stmt_expr_attr -> pretty & ui tests 2019-12-20 22:53:40 +01:00
attr-derive.rs Remove licenses 2018-12-25 21:08:33 -07:00
attr-fn-inner.rs Introduce #[rustc_dummy] attribute and use it in tests 2019-06-08 23:55:25 +03:00
attr-literals.rs Update pretty tests 2020-03-17 20:58:31 +01:00
attr-tokens-raw-ident.rs pprust: Do not convert attributes into MetaItems for printing 2019-07-15 12:42:07 +03:00
auto-trait.rs Remove licenses 2018-12-25 21:08:33 -07:00
blank-lines.rs Remove licenses 2018-12-25 21:08:33 -07:00
block-comment-multiple-asterisks.rs Remove licenses 2018-12-25 21:08:33 -07:00
block-comment-trailing-whitespace.rs Remove licenses 2018-12-25 21:08:33 -07:00
block-comment-trailing-whitespace2.rs Remove licenses 2018-12-25 21:08:33 -07:00
block-comment-wchar.pp pprust: adjust mixed comment printing 2020-08-02 15:33:03 +01:00
block-comment-wchar.rs Remove licenses 2018-12-25 21:08:33 -07:00
block-disambig.rs Remove licenses 2018-12-25 21:08:33 -07:00
cast-lt.pp pprust: Fix formatting regressions from the previous commits 2019-07-15 12:42:07 +03:00
cast-lt.rs Remove licenses 2018-12-25 21:08:33 -07:00
closure-reform-pretty.rs Remove licenses 2018-12-25 21:08:33 -07:00
delimited-token-groups.rs Update pretty tests 2020-03-17 20:58:31 +01:00
disamb-stmt-expr.rs Remove licenses 2018-12-25 21:08:33 -07:00
do1.rs pprust: Do not print spaces before some tokens 2019-08-25 21:23:17 +03:00
doc-comments.rs Remove licenses 2018-12-25 21:08:33 -07:00
dollar-crate.pp resolve: Remove remaining special cases from built-in macros 2019-08-10 21:50:56 +03:00
dollar-crate.rs Pretty print $crate as crate or crate_name in more cases 2019-01-26 17:11:28 +03:00
empty-impl.rs Remove licenses 2018-12-25 21:08:33 -07:00
empty-lines.rs Remove licenses 2018-12-25 21:08:33 -07:00
enum-variant-vis.rs Print the visibility in print_variant. 2019-12-07 05:59:41 +01:00
example1.rs Remove licenses 2018-12-25 21:08:33 -07:00
example2.pp Remove licenses 2018-12-25 21:08:33 -07:00
example2.rs Remove licenses 2018-12-25 21:08:33 -07:00
fn-return.rs Remove licenses 2018-12-25 21:08:33 -07:00
fn-types.rs Remove licenses 2018-12-25 21:08:33 -07:00
fn-variadic.rs Nit 2019-03-03 02:58:09 +00:00
for-comment.rs Remove licenses 2018-12-25 21:08:33 -07:00
gat-bounds.rs print vis & defaultness for nested items 2020-02-21 18:30:56 +01:00
if-attr.rs Extent pretty-print test 2020-03-04 16:43:14 -05:00
import-renames.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-4264.pp pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
issue-4264.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-12590-a.rs use pretty-compare-only in a test 2020-03-18 15:08:25 +01:00
issue-12590-b.rs Moved issue tests to subdirs and normalised names. 2019-03-14 01:00:49 +00:00
issue-12590-c.pp Moved issue tests to subdirs and normalised names. 2019-03-14 01:00:49 +00:00
issue-12590-c.rs Moved issue tests to subdirs and normalised names. 2019-03-14 01:00:49 +00:00
issue-19077.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-25031.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-30731.rs pprust: Fix formatting regressions from the previous commits 2019-07-15 12:42:07 +03:00
issue-31073.pp Remove licenses 2018-12-25 21:08:33 -07:00
issue-31073.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-68710-field-attr-proc-mac-lost.rs Update pretty tests 2020-03-17 20:58:31 +01:00
issue-73626.rs pprust: support multiline comments within lines 2020-07-12 18:22:09 +01:00
issue-74745.rs tests: add regression test for #74745 2020-08-02 15:33:06 +01:00
let.rs Remove licenses 2018-12-25 21:08:33 -07:00
lifetime.rs Remove licenses 2018-12-25 21:08:33 -07:00
llvm-asm-clobbers.rs Add tests for asm! 2020-05-18 14:41:32 +01:00
llvm-asm-options.rs Add tests for asm! 2020-05-18 14:41:32 +01:00
macro.rs Print visibility of macro items 2019-09-15 10:22:13 +01:00
match-block-expr.rs pprust: Do not print spaces before some tokens 2019-08-25 21:23:17 +03:00
match-naked-expr-medium.rs Remove licenses 2018-12-25 21:08:33 -07:00
match-naked-expr.rs Remove licenses 2018-12-25 21:08:33 -07:00
nested-item-vis-defaultness.rs print vis & defaultness for nested items 2020-02-21 18:30:56 +01:00
path-type-bounds.rs Remove licenses 2018-12-25 21:08:33 -07:00
raw-address-of.rs Add more tests for raw_ref_op 2019-12-18 20:30:00 +00:00
raw-str-nonexpr.rs Update tests to use llvm_asm! 2020-03-26 15:49:22 +00:00
stmt_expr_attributes.rs Remove meaningless comments in src/test 2019-08-16 10:54:20 +01:00
struct-pattern.rs Remove licenses 2018-12-25 21:08:33 -07:00
struct-tuple.rs Remove licenses 2018-12-25 21:08:33 -07:00
tag-blank-lines.rs Remove licenses 2018-12-25 21:08:33 -07:00
top-level-doc-comments.rs Remove unused ignore-license directives 2020-01-24 00:00:00 +00:00
trait-inner-attr.rs parser: unify item list parsing. 2020-02-13 15:16:29 +01:00
trait-polarity.rs introduce negative_impls feature gate and document 2020-03-26 06:52:55 -04:00
trait-safety.rs Remove licenses 2018-12-25 21:08:33 -07:00
unary-op-disambig.rs Remove licenses 2018-12-25 21:08:33 -07:00
vec-comments.pp Remove licenses 2018-12-25 21:08:33 -07:00
vec-comments.rs Remove licenses 2018-12-25 21:08:33 -07:00
where-clauses.rs Remove licenses 2018-12-25 21:08:33 -07:00