InhabitedPredicate: avoid using a wildcard branch
This is error-prone. Explicitly write down which cases don't need anything substituted. Turn the `OpaqueType` case, which currently seems to be unreachable, into a `bug!`.
This commit is contained in:
parent
da3e73654f
commit
a3d63fb0d4
1 changed files with 4 additions and 1 deletions
|
@ -265,7 +265,10 @@ impl<'tcx> InhabitedPredicate<'tcx> {
|
|||
Some(InhabitedPredicate::True) => Some(InhabitedPredicate::True),
|
||||
Some(a) => Some(a.or(tcx, b.instantiate_opt(tcx, args).unwrap_or(b))),
|
||||
},
|
||||
_ => None,
|
||||
Self::True | Self::False | Self::NotInModule(_) => None,
|
||||
Self::OpaqueType(_) => {
|
||||
bug!("unexpected OpaqueType in InhabitedPredicate");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue