summaryrefslogtreecommitdiffstats
path: root/src/test/ui/coherence/coherence-with-generator.rs
blob: d34c391db9fb0bcb1f7306fd793a05b01f1a3541 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Test that encountering closures during coherence does not cause issues.
#![feature(type_alias_impl_trait, generators)]
type OpaqueGenerator = impl Sized;
fn defining_use() -> OpaqueGenerator {
    || {
        for i in 0..10 {
            yield i;
        }
    }
}

struct Wrapper<T>(T);
trait Trait {}
impl Trait for Wrapper<OpaqueGenerator> {}
//~^ ERROR cannot implement trait on type alias impl trait
impl<T: Sync> Trait for Wrapper<T> {}
//~^ ERROR conflicting implementations of trait `Trait` for type `Wrapper<OpaqueGenerator>`

fn main() {}