Skip to content

Rollup of 5 pull requests #42173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 24 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b384b18
Refactor: Move the mutable parts out of LintStore. Fix #42007.
kennytm May 15, 2017
f8b66a0
trace_macro: Show both the macro call and its expansion. #42072.
jorendorff May 19, 2017
a355c67
Use the improved submodule handling
ishitatsuyuki May 18, 2017
ed49d7c
Format bootstrap.py using autopep8
ishitatsuyuki May 19, 2017
8f111f3
bootstrap.py: Filter instead of iteration
ishitatsuyuki May 19, 2017
d34aaa1
bootstrap.py: decode to str
ishitatsuyuki May 22, 2017
6dde3f4
Move some tests from compile-fail to ui
oli-obk May 16, 2017
ec1fa6d
Change macro typo helps to suggestions
oli-obk May 16, 2017
27359bd
Change enum variant help into a suggestion
oli-obk May 16, 2017
e328ef0
Change some "did you mean `self.*`" messages to suggestions
oli-obk May 16, 2017
8add02a
Changes in ui tests
oli-obk May 16, 2017
e618a4f
Add some guidelines for suggestion messages and follow them
oli-obk May 18, 2017
a9b54ab
Update ui tests output
oli-obk May 18, 2017
9d41d0e
Move a compile-fail test to ui
oli-obk May 18, 2017
bff4795
Tidy errors
oli-obk May 18, 2017
6f681c2
Fix line numbers in ui test
oli-obk May 22, 2017
1343bc6
Readd //~ERROR messages
oli-obk May 22, 2017
150d644
rustbuild: split Install out of Dist subcommand
Keruspe May 18, 2017
72eb010
update-all-references.sh doesn't deterministically work on ui-fulldeps
oli-obk May 23, 2017
5960da2
Rollup merge of #42033 - oli-obk:suggestions, r=petrochenkov
frewsxcv May 23, 2017
b2310e1
Rollup merge of #42052 - kennytm:fix-42007-ice-on-decode-lint-id, r=n…
frewsxcv May 23, 2017
f43960f
Rollup merge of #42081 - ishitatsuyuki:submodule-better, r=aidanhs
frewsxcv May 23, 2017
d1f6df3
Rollup merge of #42103 - jorendorff:master, r=estebank
frewsxcv May 23, 2017
61e9ff9
Rollup merge of #42109 - Keruspe:master, r=alexcrichton
frewsxcv May 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change enum variant help into a suggestion
  • Loading branch information
oli-obk committed May 22, 2017
commit 27359bdebbb376ab690d23db6cbda2544d12c5ea
9 changes: 5 additions & 4 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2307,13 +2307,14 @@ impl<'a> Resolver<'a> {
.map(|suggestion| import_candidate_to_paths(&suggestion)).collect::<Vec<_>>();
enum_candidates.sort();
for (sp, variant_path, enum_path) in enum_candidates {
let msg = format!("there is an enum variant `{}`, did you mean to use `{}`?",
variant_path,
enum_path);
if sp == DUMMY_SP {
let msg = format!("there is an enum variant `{}`,\
did you mean to use `{}`?",
variant_path,
enum_path);
err.help(&msg);
} else {
err.span_help(sp, &msg);
err.span_suggestion(span, "did you mean the variant's enum", enum_path);
}
}
}
Expand Down