]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/issue-66580-closure-coherence.rs
Rollup merge of #106716 - c410-f3r:rfc-2397-1, r=davidtwco
[rust.git] / tests / ui / type-alias-impl-trait / issue-66580-closure-coherence.rs
1 // Regression test for issue #66580
2 // Ensures that we don't try to determine whether a closure
3 // is foreign when it's the underlying type of an opaque type
4 // check-pass
5 #![feature(type_alias_impl_trait)]
6
7 type Closure = impl FnOnce();
8
9 fn closure() -> Closure {
10     || {}
11 }
12
13 struct Wrap<T> {
14     f: T,
15 }
16
17 impl Wrap<Closure> {}
18
19 impl<T> Wrap<T> {}
20
21 fn main() {}