We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b31983 commit 57bb970Copy full SHA for 57bb970
compiler/rustc_hir_analysis/src/collect/dump.rs
@@ -11,6 +11,15 @@ pub(crate) fn opaque_hidden_types(tcx: TyCtxt<'_>) {
11
}
12
13
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
+
23
let ty = tcx.type_of(id).instantiate_identity();
24
let span = tcx.def_span(id);
25
tcx.dcx().emit_err(crate::errors::TypeOf { span, ty });
0 commit comments