- //
- // If `AbstractConst::from_const` returned an error we already failed compilation
- // so we don't have to emit an additional error here.
- use rustc_middle::ty::abstract_const::Node;
- if let Ok(Some(ct)) = AbstractConst::from_const(self.tcx, ct) {
- walk_abstract_const(self.tcx, ct, |node| match node.root(self.tcx) {
- Node::Leaf(leaf) => self.visit_const(leaf),
- Node::Cast(_, _, ty) => self.visit_ty(ty),
- Node::Binop(..) | Node::UnaryOp(..) | Node::FunctionCall(_, _) => {
- ControlFlow::CONTINUE
- }
- })
- } else {
- ct.super_visit_with(self)
- }