1
Fork 0

Invert IgnoreRegions to CheckRegions

This commit is contained in:
Oli Scherer 2023-04-25 07:36:58 +00:00
parent f08b517597
commit 31ae7c46bd
3 changed files with 8 additions and 8 deletions

View file

@ -34,9 +34,9 @@ pub struct Discr<'tcx> {
/// Used as an input to [`TyCtxt::uses_unique_generic_params`].
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum IgnoreRegions {
Yes,
pub enum CheckRegions {
No,
OnlyEarlyBound,
}
#[derive(Copy, Clone, Debug)]
@ -468,13 +468,13 @@ impl<'tcx> TyCtxt<'tcx> {
pub fn uses_unique_generic_params(
self,
substs: SubstsRef<'tcx>,
ignore_regions: IgnoreRegions,
ignore_regions: CheckRegions,
) -> Result<(), NotUniqueParam<'tcx>> {
let mut seen = GrowableBitSet::default();
for arg in substs {
match arg.unpack() {
GenericArgKind::Lifetime(lt) => {
if ignore_regions == IgnoreRegions::No {
if ignore_regions == CheckRegions::OnlyEarlyBound {
let ty::ReEarlyBound(p) = lt.kind() else {
return Err(NotUniqueParam::NotParam(lt.into()))
};