1
Fork 0

Rollup merge of #111951 - cjgillot:uninh-comment, r=Nadrieril

Correct comment on privately uninhabited pattern.

Follow-up to https://github.com/rust-lang/rust/pull/111624#discussion_r1204767933

r? `@Nadrieril`
This commit is contained in:
Matthias Krüger 2023-05-26 08:24:09 +02:00 committed by GitHub
commit dd74ae0929
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 179 additions and 78 deletions

View file

@ -491,8 +491,8 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> {
AdtDefinedHere { adt_def_span, ty, variants }
};
// Emit an extra note if the first uncovered witness is
// visibly uninhabited anywhere in the current crate.
// Emit an extra note if the first uncovered witness would be uninhabited
// if we disregard visibility.
let witness_1_is_privately_uninhabited =
if cx.tcx.features().exhaustive_patterns
&& let Some(witness_1) = witnesses.get(0)