Skip to content

Commit e49b462

Browse files
Don't compute opt_suggest_box_span for TAIT
1 parent 397641f commit e49b462

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

compiler/rustc_hir_typeck/src/_match.rs

+8
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
510510
..
511511
} = self.type_var_origin(expected)? else { return None; };
512512

513+
let Some(rpit_local_def_id) = rpit_def_id.as_local() else { return None; };
514+
if !matches!(
515+
self.tcx.hir().expect_item(rpit_local_def_id).expect_opaque_ty().origin,
516+
hir::OpaqueTyOrigin::FnReturn(..)
517+
) {
518+
return None;
519+
}
520+
513521
let sig = self.body_fn_sig()?;
514522

515523
let substs = sig.output().walk().find_map(|arg| {

0 commit comments

Comments
 (0)