Skip to content

Commit ad47fb1

Browse files
committed
Check opaque type def ids before bailing out
1 parent 5fd1ebe commit ad47fb1

File tree

1 file changed

+5
-0
lines changed
  • compiler/rustc_typeck/src/check/fn_ctxt

1 file changed

+5
-0
lines changed

compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10731073
};
10741074
let last_expr_ty = self.node_ty(last_expr.hir_id);
10751075
let needs_box = match (last_expr_ty.kind(), expected_ty.kind()) {
1076+
(ty::Opaque(last_def_id, _), ty::Opaque(exp_def_id, _))
1077+
if last_def_id == exp_def_id =>
1078+
{
1079+
StatementAsExpression::CorrectType
1080+
}
10761081
(ty::Opaque(last_def_id, last_bounds), ty::Opaque(exp_def_id, exp_bounds)) => {
10771082
debug!(
10781083
"both opaque, likely future {:?} {:?} {:?} {:?}",

0 commit comments

Comments
 (0)