about summary refs log tree commit diff
path: root/compiler/rustc_const_eval
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2023-07-29 08:20:25 +0000
committerDeadbeef <ent3rm4n@gmail.com>2023-08-02 15:38:00 +0000
commit4fec845c3f971c0ec77fccf460fe981fc50a7a12 (patch)
treec0228ce7b0bc834b714e174fd63d7e46bcc7faf6 /compiler/rustc_const_eval
parent7637653b9fdd2b2f2dc3b378891eb5cf6aea9f5d (diff)
downloadrust-4fec845c3f971c0ec77fccf460fe981fc50a7a12.tar.gz
rust-4fec845c3f971c0ec77fccf460fe981fc50a7a12.zip
Remove constness from `TraitPredicate`
Diffstat (limited to 'compiler/rustc_const_eval')
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/check.rs2
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/check.rs b/compiler/rustc_const_eval/src/transform/check_consts/check.rs
index ad5ffa6511f..b077c10907e 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/check.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/check.rs
@@ -746,6 +746,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
                 }
 
                 // Attempting to call a trait method?
+                // FIXME(effects) do we need this?
                 if let Some(trait_id) = tcx.trait_of_item(callee) {
                     trace!("attempting to call a trait method");
                     if !self.tcx.features().const_trait_impl {
@@ -761,7 +762,6 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
                     }
 
                     let trait_ref = TraitRef::from_method(tcx, trait_id, fn_args);
-                    let trait_ref = trait_ref.with_constness(ty::BoundConstness::ConstIfConst);
                     let obligation =
                         Obligation::new(tcx, ObligationCause::dummy(), param_env, trait_ref);
 
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
index b152644a551..8293bdfd969 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
@@ -155,12 +155,12 @@ impl Qualif for NeedsNonConstDrop {
             return false;
         }
 
+        // FIXME(effects) constness
         let obligation = Obligation::new(
             cx.tcx,
             ObligationCause::dummy_with_span(cx.body.span),
             cx.param_env,
-            ty::TraitRef::from_lang_item(cx.tcx, LangItem::Destruct, cx.body.span, [ty])
-                .with_constness(ty::BoundConstness::ConstIfConst),
+            ty::TraitRef::from_lang_item(cx.tcx, LangItem::Destruct, cx.body.span, [ty]),
         );
 
         let infcx = cx.tcx.infer_ctxt().build();