Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions compiler/rustc_ty_utils/src/opaque_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ enum CollectionMode {
ImplTraitInAssocTypes,
/// When collecting for an explicit `#[define_opaque]` attribute, find all TAITs
Taits,
/// The default case, only collect RPITs and AsyncFn return types, as these are
/// always defined by the current item.
/// By default collect RPITs and async function return types defined by this item
RpitAndAsyncFnOnly,
}

Expand Down Expand Up @@ -323,6 +322,12 @@ fn opaque_types_defined_by<'tcx>(
if tcx.is_typeck_child(item.to_def_id()) {
return tcx.opaque_types_defined_by(tcx.local_parent(item));
}

// delegation inherits its signature without defining its opaque types
if tcx.hir_opt_delegation_sig_id(item).is_some() {
return tcx.mk_local_def_ids(&[]);
}

let kind = tcx.def_kind(item);
trace!(?kind);
let mut collector = OpaqueTypeCollector::new(tcx, item);
Expand Down
11 changes: 0 additions & 11 deletions tests/ui/delegation/fn-header.next.stderr

This file was deleted.

3 changes: 1 addition & 2 deletions tests/ui/delegation/fn-header.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//@ revisions: old next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
//@[next] known-bug: trait-system-refactor-initiative#304
//@[old] check-pass
//@ check-pass
//@ edition:2018
//@ aux-crate:fn_header_aux=fn-header-aux.rs
//@ ignore-backends: gcc
Expand Down
19 changes: 0 additions & 19 deletions tests/ui/delegation/impl-trait.next.stderr

This file was deleted.

3 changes: 1 addition & 2 deletions tests/ui/delegation/impl-trait.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//@ revisions: old next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
//@[next] known-bug: trait-system-refactor-initiative#304
//@[old] check-pass
//@ check-pass

#![feature(fn_delegation)]

Expand Down
Loading