1
Fork 0

Correct comment on privately uninhabited pattern.

This commit is contained in:
Camille GILLOT 2023-05-25 16:28:29 +00:00
parent d300bffa4f
commit 18952929ff

View file

@ -479,8 +479,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)