1 // revisions: full generic_arg
2 // compile-flags: -Zborrowck=mir
3 // can't run rustfix because it doesn't handle multipart suggestions correctly
4 // we need the above to avoid ast borrowck failure in recovered code
5 #![cfg_attr(generic_arg, feature(generic_arg_infer))]
6 
7 
8 struct S<'a, T> {
9     a: &'a T,
10     b: &'a T,
11 }
12 
foo<'a, 'b>(start: &'a usize, end: &'a usize)13 fn foo<'a, 'b>(start: &'a usize, end: &'a usize) {
14     let _x = (*start..*end)
15         .map(|x| S { a: start, b: end })
16         .collect::<Vec<S<_, 'a>>>();
17         //[generic_arg]~^ ERROR inferred provided when a lifetime was expected
18         //[full]~^^ ERROR type provided when a lifetime was expected
19 }
20 
main()21 fn main() {}
22