Add more tests + visit_ty in some places
This commit is contained in:
parent
8e7299dfcd
commit
c318364d48
6 changed files with 62 additions and 21 deletions
|
@ -97,10 +97,19 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
|
|||
|
||||
ControlFlow::CONTINUE
|
||||
}
|
||||
Node::Binop(_, _, _)
|
||||
| Node::UnaryOp(_, _)
|
||||
| Node::FunctionCall(_, _)
|
||||
| Node::Cast(_, _, _) => ControlFlow::CONTINUE,
|
||||
Node::Cast(_, _, ty) => {
|
||||
let ty = ty.subst(tcx, ct.substs);
|
||||
if ty.has_infer_types_or_consts() {
|
||||
failure_kind = FailureKind::MentionsInfer;
|
||||
} else if ty.has_param_types_or_consts() {
|
||||
failure_kind = cmp::min(failure_kind, FailureKind::MentionsParam);
|
||||
}
|
||||
|
||||
ControlFlow::CONTINUE
|
||||
}
|
||||
Node::Binop(_, _, _) | Node::UnaryOp(_, _) | Node::FunctionCall(_, _) => {
|
||||
ControlFlow::CONTINUE
|
||||
}
|
||||
});
|
||||
|
||||
match failure_kind {
|
||||
|
|
|
@ -838,10 +838,10 @@ fn contains_illegal_self_type_reference<'tcx, T: TypeFoldable<'tcx>>(
|
|||
let leaf = leaf.subst(self.tcx, ct.substs);
|
||||
self.visit_const(leaf)
|
||||
}
|
||||
Node::Binop(..)
|
||||
| Node::UnaryOp(..)
|
||||
| Node::FunctionCall(_, _)
|
||||
| Node::Cast(_, _, _) => ControlFlow::CONTINUE,
|
||||
Node::Cast(_, _, ty) => self.visit_ty(ty),
|
||||
Node::Binop(..) | Node::UnaryOp(..) | Node::FunctionCall(_, _) => {
|
||||
ControlFlow::CONTINUE
|
||||
}
|
||||
})
|
||||
} else {
|
||||
ControlFlow::CONTINUE
|
||||
|
@ -860,10 +860,10 @@ fn contains_illegal_self_type_reference<'tcx, T: TypeFoldable<'tcx>>(
|
|||
let leaf = leaf.subst(self.tcx, ct.substs);
|
||||
self.visit_const(leaf)
|
||||
}
|
||||
Node::Binop(..)
|
||||
| Node::UnaryOp(..)
|
||||
| Node::FunctionCall(_, _)
|
||||
| Node::Cast(_, _, _) => ControlFlow::CONTINUE,
|
||||
Node::Cast(_, _, ty) => self.visit_ty(ty),
|
||||
Node::Binop(..) | Node::UnaryOp(..) | Node::FunctionCall(_, _) => {
|
||||
ControlFlow::CONTINUE
|
||||
}
|
||||
})
|
||||
} else {
|
||||
ControlFlow::CONTINUE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue