about summary refs log tree commit diff
path: root/compiler/rustc_privacy/src
diff options
context:
space:
mode:
authorkadmin <julianknodt@gmail.com>2022-10-25 08:16:43 +0000
committerkadmin <julianknodt@gmail.com>2022-11-25 09:28:43 +0000
commit5bb1a9febce13dbe7ece9cdb3248b52c1ac44cc5 (patch)
tree7a7c8cd30dd83c745b3c253e0354acb76e6c2e8f /compiler/rustc_privacy/src
parentf9750c1554a355a3755a412581c57b230248f06d (diff)
downloadrust-5bb1a9febce13dbe7ece9cdb3248b52c1ac44cc5.tar.gz
rust-5bb1a9febce13dbe7ece9cdb3248b52c1ac44cc5.zip
Add expand_abstract_const
Adds the ability to directly expand a const to an expr without having to deal with intermediate
steps.
Diffstat (limited to 'compiler/rustc_privacy/src')
-rw-r--r--compiler/rustc_privacy/src/lib.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs
index 580a9eb091c..f8e99006923 100644
--- a/compiler/rustc_privacy/src/lib.rs
+++ b/compiler/rustc_privacy/src/lib.rs
@@ -287,12 +287,8 @@ where
         self.visit_ty(c.ty())?;
         let tcx = self.def_id_visitor.tcx();
         if let ty::ConstKind::Unevaluated(uv) = c.kind() &&
-           let Ok(Some(ct)) = tcx.expand_bound_abstract_const(tcx.bound_abstract_const(uv.def),
-           uv.substs) {
-            ct.visit_with(self)?;
-        }
-        if let ty::ConstKind::Expr(e) = c.kind() {
-            e.visit_with(self)?;
+           let Ok(Some(ct)) = tcx.expand_unevaluated_abstract_const(uv.def, uv.substs) {
+            ct.super_visit_with(self)?;
         }
         ControlFlow::CONTINUE
     }