about summary refs log tree commit diff
path: root/compiler/rustc_infer/src
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2023-07-27 15:50:42 +0000
committerDeadbeef <ent3rm4n@gmail.com>2023-07-27 15:50:42 +0000
commite6b423aebb7ef4b1f0b717243f435ac636aa79bc (patch)
tree06452afe44372dd29c2e48a83523221da6281500 /compiler/rustc_infer/src
parent3e11b223d7ad9836babf2d531b0ca6d13ff3f065 (diff)
downloadrust-e6b423aebb7ef4b1f0b717243f435ac636aa79bc.tar.gz
rust-e6b423aebb7ef4b1f0b717243f435ac636aa79bc.zip
Remove `constness` from `ParamEnv`
Diffstat (limited to 'compiler/rustc_infer/src')
-rw-r--r--compiler/rustc_infer/src/traits/mod.rs9
1 files changed, 0 insertions, 9 deletions
diff --git a/compiler/rustc_infer/src/traits/mod.rs b/compiler/rustc_infer/src/traits/mod.rs
index 626dd9359a1..a9da6104b38 100644
--- a/compiler/rustc_infer/src/traits/mod.rs
+++ b/compiler/rustc_infer/src/traits/mod.rs
@@ -79,7 +79,6 @@ impl<'tcx> PredicateObligation<'tcx> {
     }
 
     pub fn without_const(mut self, tcx: TyCtxt<'tcx>) -> PredicateObligation<'tcx> {
-        self.param_env = self.param_env.without_const();
         if let ty::PredicateKind::Clause(ty::ClauseKind::Trait(trait_pred)) = self.predicate.kind().skip_binder() && trait_pred.is_const_if_const() {
             self.predicate = tcx.mk_predicate(self.predicate.kind().map_bound(|_| ty::PredicateKind::Clause(ty::ClauseKind::Trait(trait_pred.without_const()))));
         }
@@ -88,14 +87,6 @@ impl<'tcx> PredicateObligation<'tcx> {
 }
 
 impl<'tcx> PolyTraitObligation<'tcx> {
-    /// Returns `true` if the trait predicate is considered `const` in its ParamEnv.
-    pub fn is_const(&self) -> bool {
-        matches!(
-            (self.predicate.skip_binder().constness, self.param_env.constness()),
-            (ty::BoundConstness::ConstIfConst, hir::Constness::Const)
-        )
-    }
-
     pub fn derived_cause(
         &self,
         variant: impl FnOnce(DerivedObligationCause<'tcx>) -> ObligationCauseCode<'tcx>,