Skip to content

Commit c4d8089

Browse files
Revert "Add an unused field of type Option<DefId> to ParamEnv struct."
This reverts commit ab83d37.
1 parent bb6c249 commit c4d8089

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

compiler/rustc_infer/src/traits/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub type TraitObligation<'tcx> = Obligation<'tcx, ty::PolyTraitPredicate<'tcx>>;
5757

5858
// `PredicateObligation` is used a lot. Make sure it doesn't unintentionally get bigger.
5959
#[cfg(target_arch = "x86_64")]
60-
static_assert_size!(PredicateObligation<'_>, 40);
60+
static_assert_size!(PredicateObligation<'_>, 32);
6161

6262
pub type Obligations<'tcx, O> = Vec<Obligation<'tcx, O>>;
6363
pub type PredicateObligations<'tcx> = Vec<PredicateObligation<'tcx>>;

compiler/rustc_middle/src/ty/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1751,9 +1751,6 @@ pub struct ParamEnv<'tcx> {
17511751
///
17521752
/// Note: This is packed, use the reveal() method to access it.
17531753
packed: CopyTaggedPtr<&'tcx List<Predicate<'tcx>>, traits::Reveal, true>,
1754-
1755-
/// FIXME: This field is not used, but removing it causes a performance degradation. See #76913.
1756-
unused_field: Option<DefId>,
17571754
}
17581755

17591756
unsafe impl rustc_data_structures::tagged_ptr::Tag for traits::Reveal {
@@ -1834,7 +1831,7 @@ impl<'tcx> ParamEnv<'tcx> {
18341831
/// Construct a trait environment with the given set of predicates.
18351832
#[inline]
18361833
pub fn new(caller_bounds: &'tcx List<Predicate<'tcx>>, reveal: Reveal) -> Self {
1837-
ty::ParamEnv { packed: CopyTaggedPtr::new(caller_bounds, reveal), unused_field: None }
1834+
ty::ParamEnv { packed: CopyTaggedPtr::new(caller_bounds, reveal) }
18381835
}
18391836

18401837
pub fn with_user_facing(mut self) -> Self {

compiler/rustc_trait_selection/src/traits/fulfill.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub struct PendingPredicateObligation<'tcx> {
8787

8888
// `PendingPredicateObligation` is used a lot. Make sure it doesn't unintentionally get bigger.
8989
#[cfg(target_arch = "x86_64")]
90-
static_assert_size!(PendingPredicateObligation<'_>, 64);
90+
static_assert_size!(PendingPredicateObligation<'_>, 56);
9191

9292
impl<'a, 'tcx> FulfillmentContext<'tcx> {
9393
/// Creates a new fulfillment context.

0 commit comments

Comments
 (0)