Commit graph

19 commits

Author SHA1 Message Date
Albert Larsan
cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00
Michael Goulet
7eb2d4e7d0 Generalize call suggestion for unsatisfied predicate 2022-10-19 02:06:19 +00:00
Obei Sideg
1383f0e9af Make the trait bound is not satisfied specify kind 2022-08-29 16:53:36 +03:00
Camille GILLOT
8cc87250ef Shorten span for closures. 2022-07-07 09:27:42 +02:00
Eric Holk
3268bf1d31 Update .stderr files 2021-12-02 16:12:25 -08:00
Michael Goulet
f6392a1614 Print output ty for opaque future ty 2021-11-18 13:19:18 -08:00
Esteban Kuber
569a842730 Point at call span that introduced obligation for the arg 2021-09-16 12:12:27 +00:00
Esteban Küber
39f220ce12 Use note to point at bound introducing requirement 2021-08-16 17:47:22 +00:00
Esteban Küber
99f2977031 Modify structured suggestion output
* On suggestions that include deletions, use a diff inspired output format
* When suggesting addition, use `+` as underline
* Color highlight modified span
2021-08-11 09:46:24 +00: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
Nell Shamrell
5e28eb580f Adds a clearer message for when the async keyword is missing from a function
Signed-off-by: Nell Shamrell <nellshamrell@gmail.com>
2020-06-25 16:01:45 -07:00
Esteban Küber
d605a9d969 Small tweaks to required bound span 2020-04-08 14:40:51 -07:00
Esteban Küber
52fbd3e569 Increase verbosity when suggesting subtle code changes 2020-03-22 10:36:45 -07:00
Esteban Küber
0487f0c0c3 Suggest calling async closure when needed
When using an async closure as a value in a place that expects a future,
suggest calling the closure.

Fix #65923.
2019-11-16 16:24:00 -08:00
Esteban Küber
b370c111fd On obligation errors point at the unfulfilled binding when possible 2019-09-22 11:33:12 -07:00
Esteban Küber
2fbd6927a5 When possible, suggest fn call 2019-09-19 12:10:23 -07:00
Esteban Küber
02e3fb89a7 When possible point at argument causing item obligation failure 2019-09-19 12:10:23 -07:00
Esteban Küber
e553051950 review comment 2019-09-01 02:22:03 -07:00
Esteban Küber
5384d5584f Suggest call fn ctor passed as arg to fn with type param bounds 2019-08-31 00:14:23 -07:00