about summary refs log tree commit diff
path: root/compiler/rustc_privacy/src
diff options
context:
space:
mode:
authorBoxy <supbscripter@gmail.com>2022-11-24 11:09:15 +0000
committerkadmin <julianknodt@gmail.com>2022-11-25 09:28:44 +0000
commit2ac5d91d63e0cd2da3f0535163638bd9fe3020b2 (patch)
tree06bed1ceb9afd6f77d88122d527c99ca1fad4e1c /compiler/rustc_privacy/src
parent4085e94ece1ca462a89aa28e3d38a5c8742fd2e9 (diff)
downloadrust-2ac5d91d63e0cd2da3f0535163638bd9fe3020b2.tar.gz
rust-2ac5d91d63e0cd2da3f0535163638bd9fe3020b2.zip
Make `expand_abstract_consts` infallible
Diffstat (limited to 'compiler/rustc_privacy/src')
-rw-r--r--compiler/rustc_privacy/src/lib.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs
index eebff421b81..3b41b9b830e 100644
--- a/compiler/rustc_privacy/src/lib.rs
+++ b/compiler/rustc_privacy/src/lib.rs
@@ -284,14 +284,8 @@ where
     }
 
     fn visit_const(&mut self, c: Const<'tcx>) -> ControlFlow<Self::BreakTy> {
-        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_unevaluated_abstract_const(uv.def, uv.substs)
-        {
-            ct.super_visit_with(self)?;
-        }
-        ControlFlow::CONTINUE
+        tcx.expand_abstract_consts(c).super_visit_with(self)
     }
 }