diff options
| author | lcnr <rust@lcnr.de> | 2022-10-19 10:10:02 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2022-10-19 10:15:46 +0200 |
| commit | b93713fb998a723ce2d8fdc59cfc16dcfa6ffe56 (patch) | |
| tree | 7720defd93d6994e4fba2a17c2e2c3cb79ebc392 | |
| parent | c5c6ef702978d880decf14d9e7ed319e5b005537 (diff) | |
| download | rust-b93713fb998a723ce2d8fdc59cfc16dcfa6ffe56.tar.gz rust-b93713fb998a723ce2d8fdc59cfc16dcfa6ffe56.zip | |
manually inline and rm `visit_abstract_const_expr`
| -rw-r--r-- | compiler/rustc_privacy/src/lib.rs | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index 81a50481061..2636db6dbe1 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -165,20 +165,6 @@ where } } - fn visit_abstract_const_expr( - &mut self, - tcx: TyCtxt<'tcx>, - ct: AbstractConst<'tcx>, - ) -> ControlFlow<V::BreakTy> { - 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 - } - }) - } - fn visit_predicates( &mut self, predicates: ty::GenericPredicates<'tcx>, @@ -301,9 +287,16 @@ where self.visit_ty(c.ty())?; let tcx = self.def_id_visitor.tcx(); if let Ok(Some(ct)) = AbstractConst::from_const(tcx, c) { - self.visit_abstract_const_expr(tcx, ct)?; + 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 + } + }) + } else { + ControlFlow::CONTINUE } - ControlFlow::CONTINUE } } |
