]> git.lizzy.rs Git - rust.git/blob - tests/ui/higher-rank-trait-bounds/issue-36139-normalize-closure-sig.rs
Auto merge of #106711 - albertlarsan68:use-ci-llvm-when-lld, r=jyn514
[rust.git] / tests / ui / higher-rank-trait-bounds / issue-36139-normalize-closure-sig.rs
1 // run-pass
2 // Previously the closure's argument would be inferred to
3 // <S as ITrait<'a>>::Item, causing an error in MIR type
4 // checking
5
6 trait ITrait<'a> {type Item;}
7
8 struct S {}
9
10 impl<'a> ITrait<'a> for S { type Item = &'a mut usize; }
11
12 fn m<T, I, F>(_: F)
13     where I: for<'a> ITrait<'a>,
14           F: for<'a> FnMut(<I as ITrait<'a>>::Item) { }
15
16
17 fn main() {
18     m::<usize,S,_>(|x| { *x += 1; });
19 }