diff options
Diffstat (limited to 'compiler/rustc_hir_analysis/src/coherence/orphan.rs')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/coherence/orphan.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/coherence/orphan.rs b/compiler/rustc_hir_analysis/src/coherence/orphan.rs index 5ce8a83aad7..272177dfbd0 100644 --- a/compiler/rustc_hir_analysis/src/coherence/orphan.rs +++ b/compiler/rustc_hir_analysis/src/coherence/orphan.rs @@ -210,6 +210,19 @@ fn do_orphan_check_impl<'tcx>( NonlocalImpl::DisallowOther, ), + // ``` + // struct S<T>(T); + // impl<T: ?Sized> S<T> { + // type This = T; + // } + // impl<T: ?Sized> AutoTrait for S<T>::This {} + // ``` + // FIXME(inherent_associated_types): The example code above currently leads to a cycle + ty::Alias(AliasKind::Inherent, _) => ( + LocalImpl::Disallow { problematic_kind: "associated type" }, + NonlocalImpl::DisallowOther, + ), + // type Opaque = impl Trait; // impl AutoTrait for Opaque {} ty::Alias(AliasKind::Opaque, _) => ( |
