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
}
self.nodes[func].used = true;
nodes.iter().for_each(|&n| self.nodes[n].used = true);
}
+ Node::Cast(_, operand, _) => {
+ self.nodes[operand].used = true;
+ }
}
// Nodes start as unused.
self.locals[local] = self.add_node(Node::UnaryOp(op, operand), span);
Ok(())
}
+ Rvalue::Cast(cast_kind, ref operand, ty) => {
+ let operand = self.operand_to_node(span, operand)?;
+ self.locals[local] =
+ self.add_node(Node::Cast(cast_kind, operand, ty), span);
+ Ok(())
+ }
_ => self.error(Some(span), "unsupported rvalue")?,
}
}
// These are not actually relevant for us here, so we can ignore them.
- StatementKind::StorageLive(_) | StatementKind::StorageDead(_) => Ok(()),
+ StatementKind::AscribeUserType(..)
+ | StatementKind::StorageLive(_)
+ | StatementKind::StorageDead(_) => Ok(()),
_ => self.error(Some(stmt.source_info.span), "unsupported statement")?,
}
}
recurse(tcx, ct.subtree(func), f)?;
args.iter().try_for_each(|&arg| recurse(tcx, ct.subtree(arg), f))
}
+ Node::Cast(_, operand, _) => recurse(tcx, ct.subtree(operand), f),
}
}
&& iter::zip(a_args, b_args)
.all(|(&an, &bn)| try_unify(tcx, a.subtree(an), b.subtree(bn)))
}
+ (Node::Cast(a_cast_kind, a_operand, a_ty), Node::Cast(b_cast_kind, b_operand, b_ty))
+ if (a_ty == b_ty) && (a_cast_kind == b_cast_kind) =>
+ {
+ try_unify(tcx, a.subtree(a_operand), b.subtree(b_operand))
+ }
_ => false,
}
}