]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-with-closure.rs
Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into sync_cg_clif-2022-12-14
[rust.git] / src / test / 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() {}