Skip to content

Commit 27359bd

Browse files
committed
Change enum variant help into a suggestion
1 parent ec1fa6d commit 27359bd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/librustc_resolve/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,13 +2307,14 @@ impl<'a> Resolver<'a> {
23072307
.map(|suggestion| import_candidate_to_paths(&suggestion)).collect::<Vec<_>>();
23082308
enum_candidates.sort();
23092309
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);
23132310
if sp == DUMMY_SP {
2311+
let msg = format!("there is an enum variant `{}`,\
2312+
did you mean to use `{}`?",
2313+
variant_path,
2314+
enum_path);
23142315
err.help(&msg);
23152316
} else {
2316-
err.span_help(sp, &msg);
2317+
err.span_suggestion(span, "did you mean the variant's enum", enum_path);
23172318
}
23182319
}
23192320
}

0 commit comments

Comments
 (0)