diff options
| author | kadmin <julianknodt@gmail.com> | 2022-10-25 08:16:43 +0000 |
|---|---|---|
| committer | kadmin <julianknodt@gmail.com> | 2022-11-25 09:28:43 +0000 |
| commit | 5bb1a9febce13dbe7ece9cdb3248b52c1ac44cc5 (patch) | |
| tree | 7a7c8cd30dd83c745b3c253e0354acb76e6c2e8f /compiler/rustc_privacy/src | |
| parent | f9750c1554a355a3755a412581c57b230248f06d (diff) | |
| download | rust-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.rs | 8 |
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 } |
