diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-10-21 14:11:03 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-21 14:11:03 +0900 |
| commit | 6f0acbcbd064d924afb0f3a04480fd0d69c5bc51 (patch) | |
| tree | 077e50e3efba3206abbc78f14ddcac3dfe1afbb1 /compiler/rustc_privacy/src | |
| parent | fb9232b45316c3875e12a242d4250e959c7bc24a (diff) | |
| parent | be30e602969cefee2785dc25f17c34ebc4f007b3 (diff) | |
| download | rust-6f0acbcbd064d924afb0f3a04480fd0d69c5bc51.tar.gz rust-6f0acbcbd064d924afb0f3a04480fd0d69c5bc51.zip | |
Rollup merge of #88644 - eopb:abstractconst_leaf_subst, r=lcnr
`AbstractConst` private fields Calls `subst` in `AbstractConst::root` when `Node` is `Leaf`. r? ``@lcnr``
Diffstat (limited to 'compiler/rustc_privacy/src')
| -rw-r--r-- | compiler/rustc_privacy/src/lib.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index ae3a9c71c59..4d4e9432e87 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -23,7 +23,7 @@ use rustc_middle::span_bug; use rustc_middle::thir::abstract_const::Node as ACNode; use rustc_middle::ty::fold::TypeVisitor; use rustc_middle::ty::query::Providers; -use rustc_middle::ty::subst::{InternalSubsts, Subst}; +use rustc_middle::ty::subst::InternalSubsts; use rustc_middle::ty::{self, Const, GenericParamDefKind, TraitRef, Ty, TyCtxt, TypeFoldable}; use rustc_session::lint; use rustc_span::hygiene::Transparency; @@ -153,11 +153,8 @@ where tcx: TyCtxt<'tcx>, ct: AbstractConst<'tcx>, ) -> ControlFlow<V::BreakTy> { - const_evaluatable::walk_abstract_const(tcx, ct, |node| match node.root() { - ACNode::Leaf(leaf) => { - let leaf = leaf.subst(tcx, ct.substs); - self.visit_const(leaf) - } + const_evaluatable::walk_abstract_const(tcx, ct, |node| match node.root(tcx) { + ACNode::Leaf(leaf) => self.visit_const(leaf), ACNode::Cast(_, _, ty) => self.visit_ty(ty), ACNode::Binop(..) | ACNode::UnaryOp(..) | ACNode::FunctionCall(_, _) => { ControlFlow::CONTINUE |
