We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec1fa6d commit 27359bdCopy full SHA for 27359bd
src/librustc_resolve/lib.rs
@@ -2307,13 +2307,14 @@ impl<'a> Resolver<'a> {
2307
.map(|suggestion| import_candidate_to_paths(&suggestion)).collect::<Vec<_>>();
2308
enum_candidates.sort();
2309
for (sp, variant_path, enum_path) in enum_candidates {
2310
- let msg = format!("there is an enum variant `{}`, did you mean to use `{}`?",
2311
- variant_path,
2312
- enum_path);
2313
if sp == DUMMY_SP {
+ let msg = format!("there is an enum variant `{}`,\
+ did you mean to use `{}`?",
+ variant_path,
2314
+ enum_path);
2315
err.help(&msg);
2316
} else {
- err.span_help(sp, &msg);
2317
+ err.span_suggestion(span, "did you mean the variant's enum", enum_path);
2318
}
2319
2320
0 commit comments