]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/impl-trait/auto-trait.rs
1 // Tests that type alias impls traits do not leak auto-traits for
2 // the purposes of coherence checking
3 #![feature(type_alias_impl_trait)]
6 impl<T
> OpaqueTrait
for T { }
7 type OpaqueType
= impl OpaqueTrait
;
8 fn mk_opaque() -> OpaqueType { () }
13 trait AnotherTrait { }
14 impl<T
: Send
> AnotherTrait
for T { }
16 // This is in error, because we cannot assume that `OpaqueType: !Send`.
17 // (We treat opaque types as "foreign types" that could grow more impls
19 impl AnotherTrait
for D
<OpaqueType
> {
20 //~^ ERROR conflicting implementations of trait `AnotherTrait` for type `D<OpaqueType>`