Check opaque type def ids before bailing out
This commit is contained in:
parent
5fd1ebe50f
commit
ad47fb1ca9
1 changed files with 5 additions and 0 deletions
|
@ -1073,6 +1073,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
};
|
};
|
||||||
let last_expr_ty = self.node_ty(last_expr.hir_id);
|
let last_expr_ty = self.node_ty(last_expr.hir_id);
|
||||||
let needs_box = match (last_expr_ty.kind(), expected_ty.kind()) {
|
let needs_box = match (last_expr_ty.kind(), expected_ty.kind()) {
|
||||||
|
(ty::Opaque(last_def_id, _), ty::Opaque(exp_def_id, _))
|
||||||
|
if last_def_id == exp_def_id =>
|
||||||
|
{
|
||||||
|
StatementAsExpression::CorrectType
|
||||||
|
}
|
||||||
(ty::Opaque(last_def_id, last_bounds), ty::Opaque(exp_def_id, exp_bounds)) => {
|
(ty::Opaque(last_def_id, last_bounds), ty::Opaque(exp_def_id, exp_bounds)) => {
|
||||||
debug!(
|
debug!(
|
||||||
"both opaque, likely future {:?} {:?} {:?} {:?}",
|
"both opaque, likely future {:?} {:?} {:?} {:?}",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue