]> git.lizzy.rs Git - rust.git/blob - tests/ui/coherence/coherence-with-closure.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / coherence / coherence-with-closure.rs
1 // Test that encountering closures during coherence does not cause issues.
2 #![feature(type_alias_impl_trait)]
3 type OpaqueClosure = impl Sized;
4 fn defining_use() -> OpaqueClosure {
5     || ()
6 }
7
8 struct Wrapper<T>(T);
9 trait Trait {}
10 impl Trait for Wrapper<OpaqueClosure> {}
11 impl<T: Sync> Trait for Wrapper<T> {}
12 //~^ ERROR conflicting implementations of trait `Trait` for type `Wrapper<OpaqueClosure>`
13
14 fn main() {}