summaryrefslogtreecommitdiffstats
path: root/src/test/ui/coherence/coherence-with-generator.rs
blob: 70665ba06f95435b138f5c608ae0d2dfed43153f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 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> {}
impl<T: Sync> Trait for Wrapper<T> {}
//~^ ERROR conflicting implementations of trait `Trait` for type `Wrapper<OpaqueGenerator>`

fn main() {}