]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs
Rollup merge of #106113 - krasimirgg:llvm-16-ext-tyid, r=nikic
[rust.git] / tests / ui / generic-associated-types / issue-68645-codegen-fulfillment.rs
1 // Regression test for #68645
2
3 trait Fun {
4     type F<'a>: Fn() -> u32;
5
6     fn callme<'a>(f: Self::F<'a>) -> u32 {
7         f()
8     }
9 }
10
11 impl<T> Fun for T {
12     type F<'a> = Self;
13     //~^ ERROR expected a `Fn<()>` closure, found `T`
14 }
15
16 fn main() {
17     <&dyn Iterator<Item = u8>>::callme(&std::iter::once(1));
18 }