Commit Graph

9 Commits

Author SHA1 Message Date
Esteban Küber
28f02fbf3e Suggest calling await on method call and field access
When encountering a failing method or field resolution on a `Future`,
look at the `Output` and try the same operation on it. If successful,
suggest calling `.await` on the `Future`.

This had already been introduced in #72784, but at some point they
stopped working.
2020-10-26 08:11:43 -07:00
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
csmoe
8ee206a80d suggest await on unexpected types 2020-08-26 17:40:08 +08:00
csmoe
2271b081eb suggest await before method 2020-08-25 14:02:55 +08:00
csmoe
1de0dd9531 suggest await on field access 2020-08-25 14:00:49 +08:00
csmoe
1d30de6202 append more test cases for issue 61076 2020-08-25 14:00:49 +08:00
csmoe
10d7da4e0b implement type_implments_trait query 2020-05-15 15:37:11 +08:00
csmoe
a1104b4dea bless ui tests 2020-05-11 14:06:57 +08:00
csmoe
32a46e9115 add test case for issue-61076 2020-05-10 22:37:24 +08:00