1
Fork 0

Rollup merge of #101357 - compiler-errors:variant-sugg-tweak, r=oli-obk

Include enum path in variant suggestion

(except for `Result` and `Option`, which we should have via the prelude)

Fixes #101356
This commit is contained in:
Guillaume Gomez 2022-09-06 17:00:25 +02:00 committed by GitHub
commit d13aefdc65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 260 additions and 244 deletions

View file

@ -754,8 +754,8 @@ fn lint_non_exhaustive_omitted_patterns<'p, 'tcx>(
hir_id: HirId,
witnesses: Vec<DeconstructedPat<'p, 'tcx>>,
) {
let joined_patterns = joined_uncovered_patterns(cx, &witnesses);
cx.tcx.struct_span_lint_hir(NON_EXHAUSTIVE_OMITTED_PATTERNS, hir_id, sp, |build| {
let joined_patterns = joined_uncovered_patterns(cx, &witnesses);
let mut lint = build.build("some variants are not matched explicitly");
lint.span_label(sp, pattern_not_covered_label(&witnesses, &joined_patterns));
lint.help(