Skip to content

Commit 57bb970

Browse files
Fix rustc_hidden_type_of_opaques for RPITITs with no default body
1 parent 7b31983 commit 57bb970

File tree

1 file changed

+9
-0
lines changed
  • compiler/rustc_hir_analysis/src/collect

1 file changed

+9
-0
lines changed

compiler/rustc_hir_analysis/src/collect/dump.rs

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ pub(crate) fn opaque_hidden_types(tcx: TyCtxt<'_>) {
1111
}
1212

1313
for id in tcx.hir_crate_items(()).opaques() {
14+
if let hir::OpaqueTyOrigin::FnReturn { parent: fn_def_id, .. }
15+
| hir::OpaqueTyOrigin::AsyncFn { parent: fn_def_id, .. } =
16+
tcx.hir().expect_opaque_ty(id).origin
17+
&& let hir::Node::TraitItem(trait_item) = tcx.hir_node_by_def_id(fn_def_id)
18+
&& let (_, hir::TraitFn::Required(..)) = trait_item.expect_fn()
19+
{
20+
continue;
21+
}
22+
1423
let ty = tcx.type_of(id).instantiate_identity();
1524
let span = tcx.def_span(id);
1625
tcx.dcx().emit_err(crate::errors::TypeOf { span, ty });

0 commit comments

Comments
 (0)