Rollup merge of #88644 - eopb:abstractconst_leaf_subst, r=lcnr
`AbstractConst` private fields Calls `subst` in `AbstractConst::root` when `Node` is `Leaf`. r? ``@lcnr``
This commit is contained in:
commit
6f0acbcbd0
3 changed files with 25 additions and 29 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue