]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-with-generator.rs
Rollup merge of #104467 - fuzzypixelz:fix/attempt-to-substract-with-overflow, r=compi...
[rust.git] / src / test / ui / coherence / coherence-with-generator.rs
1 // Test that encountering closures during coherence does not cause issues.
2 #![feature(type_alias_impl_trait, generators)]
3 type OpaqueGenerator = impl Sized;
4 fn defining_use() -> OpaqueGenerator {
5     || {
6         for i in 0..10 {
7             yield i;
8         }
9     }
10 }
11
12 struct Wrapper<T>(T);
13 trait Trait {}
14 impl Trait for Wrapper<OpaqueGenerator> {}
15 //~^ ERROR cannot implement trait on type alias impl trait
16 impl<T: Sync> Trait for Wrapper<T> {}
17 //~^ ERROR conflicting implementations of trait `Trait` for type `Wrapper<OpaqueGenerator>`
18
19 fn main() {}