Revert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk"

This reverts commit ff2439b7b9, reversing
changes made to 2a9e0831d6.
This commit is contained in:
Deadbeef 2021-12-12 12:34:46 +08:00
parent c5f8788d8d
commit 84b1d859c8
No known key found for this signature in database
GPG key ID: 6D017A96D8E6C2F9
49 changed files with 400 additions and 424 deletions

View file

@ -69,6 +69,16 @@ impl PredicateObligation<'tcx> {
}
}
impl TraitObligation<'tcx> {
/// Returns `true` if the trait predicate is considered `const` in its ParamEnv.
pub fn is_const(&self) -> bool {
match (self.predicate.skip_binder().constness, self.param_env.constness()) {
(ty::BoundConstness::ConstIfConst, hir::Constness::Const) => true,
_ => false,
}
}
}
// `PredicateObligation` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(PredicateObligation<'_>, 32);