diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2018-12-23 23:08:59 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-23 23:08:59 +0100 |
| commit | 4c971620e4bfa32df3e9da02772a2a1c68be004f (patch) | |
| tree | 91268ea5760753f959fb7c3c329c6b5f2f7d0993 /src/libsyntax/parse | |
| parent | ddab10a692aab2e2984b5c826ed9d78a57e94851 (diff) | |
| parent | 64ad3e2c423f701b856a6780380a0dbb03f90c22 (diff) | |
| download | rust-4c971620e4bfa32df3e9da02772a2a1c68be004f.tar.gz rust-4c971620e4bfa32df3e9da02772a2a1c68be004f.zip | |
Rollup merge of #56188 - zackmdavis:if_i_may_suggest, r=davidtwco
enum type instead of variant suggestion unification Fixes #56028. 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. In a second commit, we do some unprincipled special-casing to correct and beautify suggestions for `Option` and `Result` (where the existing code was being confused by their being reexported in the prelude). r? @davidtwco
Diffstat (limited to 'src/libsyntax/parse')
0 files changed, 0 insertions, 0 deletions
