]> git.proxmox.com Git - rustc.git/blob - src/test/ui/coherence/coherence-with-generator.rs
New upstream version 1.63.0+dfsg1
[rustc.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() {}