]>
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
{
16 impl<T
: Send
> AnotherTrait
for T {}
18 // This is in error, because we cannot assume that `OpaqueType: !Send`.
19 // (We treat opaque types as "foreign types" that could grow more impls
21 impl AnotherTrait
for D
<OpaqueType
> {
22 //~^ ERROR conflicting implementations of trait `AnotherTrait` for type `D<OpaqueType>`
23 //~| ERROR cannot implement trait on type alias impl trait