]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-with-closure.rs
Rollup merge of #104467 - fuzzypixelz:fix/attempt-to-substract-with-overflow, r=compi...
[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 //~^ ERROR cannot implement trait on type alias impl trait
12 impl<T: Sync> Trait for Wrapper<T> {}
13 //~^ ERROR conflicting implementations of trait `Trait` for type `Wrapper<OpaqueClosure>`
14
15 fn main() {}