Commit Graph

9 Commits

Author SHA1 Message Date
Esteban Küber
b26ddb8af3 Point at local similarly named element and tweak references to variants
Point at the span for the definition of ADTs internal to the current
crate.

Look at the leading char of the ident to determine whether we're
expecting a likely fn or any of a fn, a tuple struct or a tuple variant.

Turn fn `add_typo_suggestion` into a `Resolver` method.
2019-10-27 11:50:43 -07:00
Esteban Küber
0baf61bfdb Increase spacing for suggestions in diagnostics
Make the spacing between the code snippet and verbose structured
suggestions consistent with note and help messages.
2019-10-24 12:26:01 -07:00
Guillaume Gomez
7d357fbffd update ui tests 2019-10-16 13:56:14 +02:00
Aaron Hill
add0a42034
Remove for_each_child_stable
Now that `Resolutions` has a deterministic iteration order, it's no
longer necessary to sort its entries before iterating over them
2019-10-05 16:34:38 -04:00
Andy Russell
b6f148c8bd
hide --explain hint if error has no extended info 2019-04-18 13:29:28 -04:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Zack M. Davis
64ad3e2c42 adjust enum type instead of variant suggestions for prelude enums
The present author regrets not thinking of a more eloquent way to do
this.
2018-12-22 19:04:29 -08:00
Zack M. Davis
3986c96448 enum type instead of variant suggestion unification
Weirdly, we were deciding between a help note and a structured
suggestion based on whether the import candidate span was a dummy—but
we weren't using that span in any case! The dummy-ness of the span
(which appears to be a matter of this-crate vs. other-crate
definition) isn't the right criterion by which we should decide
whether it's germane to mention that "there is an enum variant";
instead, let's use the someness of `def` (which is used as the
`has_unexpected_resolution` argument to `error_code`).

Since `import_candidate_to_paths` has no other callers, we are free to
stop returning the span and rename the function. By using
`span_suggestions_`, we leverage the max-suggestions output limit
already built in to the emitter, thus resolving #56028.

In the matter of message wording, "you can" is redundant (and perhaps
too informal); prefer the imperative.
2018-12-22 17:40:48 -08:00
David Wood
3fc7ab2373
Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00