Skip to content

Commit

Permalink
Remove unnecessary TypeFlags::NOMINAL_FLAGS
Browse files Browse the repository at this point in the history
This was a relic from when we had "nominal flags" and "cached
properties." The latter no longer exists, so nominal flags are no
longer necessary. In fact, every flag is considered a nominal flag. I
went ahead and removed all references to NOMINAL_FLAGS.

Fixes #70836
  • Loading branch information
tsandstr committed Apr 8, 2020
1 parent 42abbd8 commit 4cdb206
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
2 changes: 1 addition & 1 deletion src/librustc_middle/ty/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl FlagComputation {
}

fn add_flags(&mut self, flags: TypeFlags) {
self.flags = self.flags | (flags & TypeFlags::NOMINAL_FLAGS);
self.flags = self.flags | flags;
}

/// indicates that `self` refers to something at binding level `binder`
Expand Down
23 changes: 0 additions & 23 deletions src/librustc_middle/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,29 +598,6 @@ bitflags! {
/// Does this value have parameters/placeholders/inference variables which could be
/// replaced later, in a way that would change the results of `impl` specialization?
const STILL_FURTHER_SPECIALIZABLE = 1 << 18;

/// Flags representing the nominal content of a type,
/// computed by FlagsComputation. If you add a new nominal
/// flag, it should be added here too.
const NOMINAL_FLAGS = TypeFlags::HAS_TY_PARAM.bits
| TypeFlags::HAS_RE_PARAM.bits
| TypeFlags::HAS_CT_PARAM.bits
| TypeFlags::HAS_TY_INFER.bits
| TypeFlags::HAS_RE_INFER.bits
| TypeFlags::HAS_CT_INFER.bits
| TypeFlags::HAS_TY_PLACEHOLDER.bits
| TypeFlags::HAS_RE_PLACEHOLDER.bits
| TypeFlags::HAS_CT_PLACEHOLDER.bits
| TypeFlags::HAS_FREE_LOCAL_REGIONS.bits
| TypeFlags::HAS_TY_PROJECTION.bits
| TypeFlags::HAS_TY_OPAQUE.bits
| TypeFlags::HAS_CT_PROJECTION.bits
| TypeFlags::KEEP_IN_LOCAL_TCX.bits
| TypeFlags::HAS_TY_ERR.bits
| TypeFlags::HAS_FREE_REGIONS.bits
| TypeFlags::HAS_RE_LATE_BOUND.bits
| TypeFlags::HAS_RE_ERASED.bits
| TypeFlags::STILL_FURTHER_SPECIALIZABLE.bits;
}
}

Expand Down

0 comments on commit 4cdb206

Please sign in to comment.