@@ -4,128 +4,106 @@ error[E0308]: mismatched types
44LL | thing(f);
55 | ^^^^^^^^ one type is more general than the other
66 |
7- = note: expected trait `for<'a, 'b> FnOnce<(&'a u32, &'b u32)>`
8- found trait `FnOnce<(&u32, &u32)>`
7+ = note: expected trait `for<'a, 'b> FnOnce<(&'a u32, &'b u32, u32 )>`
8+ found trait `for<'a> FnOnce<(&u32, &'a u32, u32)>`
99note: this closure does not fulfill the lifetime requirements
1010 --> $DIR/issue-105675.rs:4:13
1111 |
12- LL | let f = |_, _ | ();
13- | ^^^^^^
12+ LL | let f = | _ , y: &u32 , z | ();
13+ | ^^^^^^^^^^^^^^^^^^^
1414note: the lifetime requirement is introduced here
1515 --> $DIR/issue-105675.rs:1:18
1616 |
17- LL | fn thing(x: impl FnOnce(&u32, &u32)) {}
18- | ^^^^^^^^^^^^^^^^^^
17+ LL | fn thing(x: impl FnOnce(&u32, &u32, u32 )) {}
18+ | ^^^^^^^^^^^^^^^^^^^^^^^
1919help: consider specifying the type of the closure parameters
2020 |
21- LL | let f = |_: &_, _ : &_ | ();
22- | ~~~~~~~~~~~~~~
21+ LL | let f = |_: &_, y : &u32, z | ();
22+ | ~~~~~~~~~~~~~~~~~~~
2323
2424error[E0308]: mismatched types
2525 --> $DIR/issue-105675.rs:5:5
2626 |
2727LL | thing(f);
2828 | ^^^^^^^^ one type is more general than the other
2929 |
30- = note: expected trait `for<'a, 'b> FnOnce<(&'a u32, &'b u32)>`
31- found trait `FnOnce<(&u32, &u32)>`
30+ = note: expected trait `for<'a, 'b> FnOnce<(&'a u32, &'b u32, u32 )>`
31+ found trait `for<'a> FnOnce<(&u32, &'a u32, u32)>`
3232note: this closure does not fulfill the lifetime requirements
3333 --> $DIR/issue-105675.rs:4:13
3434 |
35- LL | let f = |_, _ | ();
36- | ^^^^^^
35+ LL | let f = | _ , y: &u32 , z | ();
36+ | ^^^^^^^^^^^^^^^^^^^
3737note: the lifetime requirement is introduced here
3838 --> $DIR/issue-105675.rs:1:18
3939 |
40- LL | fn thing(x: impl FnOnce(&u32, &u32)) {}
41- | ^^^^^^^^^^^^^^^^^^
42- help: consider specifying the type of the closure parameters
43- |
44- LL | let f = |_: &_, _: &_| ();
45- | ~~~~~~~~~~~~~~
46-
47- error: implementation of `FnOnce` is not general enough
48- --> $DIR/issue-105675.rs:5:5
49- |
50- LL | thing(f);
51- | ^^^^^^^^ implementation of `FnOnce` is not general enough
52- |
53- = note: closure with signature `fn(&'2 u32, &u32)` must implement `FnOnce<(&'1 u32, &u32)>`, for any lifetime `'1`...
54- = note: ...but it actually implements `FnOnce<(&'2 u32, &u32)>`, for some specific lifetime `'2`
55-
56- error: implementation of `FnOnce` is not general enough
57- --> $DIR/issue-105675.rs:5:5
58- |
59- LL | thing(f);
60- | ^^^^^^^^ implementation of `FnOnce` is not general enough
61- |
62- = note: closure with signature `fn(&u32, &'2 u32)` must implement `FnOnce<(&u32, &'1 u32)>`, for any lifetime `'1`...
63- = note: ...but it actually implements `FnOnce<(&u32, &'2 u32)>`, for some specific lifetime `'2`
40+ LL | fn thing(x: impl FnOnce(&u32, &u32, u32)) {}
41+ | ^^^^^^^^^^^^^^^^^^^^^^^
6442
6543error[E0308]: mismatched types
66- --> $DIR/issue-105675.rs:11 :5
44+ --> $DIR/issue-105675.rs:9 :5
6745 |
6846LL | thing(f);
6947 | ^^^^^^^^ one type is more general than the other
7048 |
71- = note: expected trait `for<'a, 'b> FnOnce<(&'a u32, &'b u32)>`
72- found trait `FnOnce<(&u32, &u32)>`
49+ = note: expected trait `for<'a, 'b> FnOnce<(&'a u32, &'b u32, u32 )>`
50+ found trait `FnOnce<(&u32, &u32, u32 )>`
7351note: this closure does not fulfill the lifetime requirements
74- --> $DIR/issue-105675.rs:10 :13
52+ --> $DIR/issue-105675.rs:8 :13
7553 |
76- LL | let f = |x, y| ();
77- | ^^^^^^
54+ LL | let f = | x, y: _ , z: u32 | ();
55+ | ^^^^^^^^^^^^^^^^^^^^^
7856note: the lifetime requirement is introduced here
7957 --> $DIR/issue-105675.rs:1:18
8058 |
81- LL | fn thing(x: impl FnOnce(&u32, &u32)) {}
82- | ^^^^^^^^^^^^^^^^^^
59+ LL | fn thing(x: impl FnOnce(&u32, &u32, u32 )) {}
60+ | ^^^^^^^^^^^^^^^^^^^^^^^
8361help: consider specifying the type of the closure parameters
8462 |
85- LL | let f = |x: &_, y: &_| ();
86- | ~~~~~~~~~~~~~~
63+ LL | let f = |x: &_, y: &_, z: u32 | ();
64+ | ~~~~~~~~~~~~~~~~~~~~~~
8765
8866error[E0308]: mismatched types
89- --> $DIR/issue-105675.rs:11 :5
67+ --> $DIR/issue-105675.rs:9 :5
9068 |
9169LL | thing(f);
9270 | ^^^^^^^^ one type is more general than the other
9371 |
94- = note: expected trait `for<'a, 'b> FnOnce<(&'a u32, &'b u32)>`
95- found trait `FnOnce<(&u32, &u32)>`
72+ = note: expected trait `for<'a, 'b> FnOnce<(&'a u32, &'b u32, u32 )>`
73+ found trait `FnOnce<(&u32, &u32, u32 )>`
9674note: this closure does not fulfill the lifetime requirements
97- --> $DIR/issue-105675.rs:10 :13
75+ --> $DIR/issue-105675.rs:8 :13
9876 |
99- LL | let f = |x, y| ();
100- | ^^^^^^
77+ LL | let f = | x, y: _ , z: u32 | ();
78+ | ^^^^^^^^^^^^^^^^^^^^^
10179note: the lifetime requirement is introduced here
10280 --> $DIR/issue-105675.rs:1:18
10381 |
104- LL | fn thing(x: impl FnOnce(&u32, &u32)) {}
105- | ^^^^^^^^^^^^^^^^^^
82+ LL | fn thing(x: impl FnOnce(&u32, &u32, u32 )) {}
83+ | ^^^^^^^^^^^^^^^^^^^^^^^
10684help: consider specifying the type of the closure parameters
10785 |
108- LL | let f = |x: &_, y: &_| ();
109- | ~~~~~~~~~~~~~~
86+ LL | let f = |x: &_, y: &_, z: u32 | ();
87+ | ~~~~~~~~~~~~~~~~~~~~~~
11088
11189error: implementation of `FnOnce` is not general enough
112- --> $DIR/issue-105675.rs:11 :5
90+ --> $DIR/issue-105675.rs:9 :5
11391 |
11492LL | thing(f);
11593 | ^^^^^^^^ implementation of `FnOnce` is not general enough
11694 |
117- = note: closure with signature `fn(&'2 u32, &u32)` must implement `FnOnce<(&'1 u32, &u32)>`, for any lifetime `'1`...
118- = note: ...but it actually implements `FnOnce<(&'2 u32, &u32)>`, for some specific lifetime `'2`
95+ = note: closure with signature `fn(&'2 u32, &u32, u32 )` must implement `FnOnce<(&'1 u32, &u32, u32)>`, for any lifetime `'1`...
96+ = note: ...but it actually implements `FnOnce<(&'2 u32, &u32, u32 )>`, for some specific lifetime `'2`
11997
12098error: implementation of `FnOnce` is not general enough
121- --> $DIR/issue-105675.rs:11 :5
99+ --> $DIR/issue-105675.rs:9 :5
122100 |
123101LL | thing(f);
124102 | ^^^^^^^^ implementation of `FnOnce` is not general enough
125103 |
126- = note: closure with signature `fn(&u32, &'2 u32)` must implement `FnOnce<(&u32, &'1 u32)>`, for any lifetime `'1`...
127- = note: ...but it actually implements `FnOnce<(&u32, &'2 u32)>`, for some specific lifetime `'2`
104+ = note: closure with signature `fn(&u32, &'2 u32, u32 )` must implement `FnOnce<(&u32, &'1 u32, u32)>`, for any lifetime `'1`...
105+ = note: ...but it actually implements `FnOnce<(&u32, &'2 u32, u32 )>`, for some specific lifetime `'2`
128106
129- error: aborting due to 8 previous errors
107+ error: aborting due to 6 previous errors
130108
131109For more information about this error, try `rustc --explain E0308`.
0 commit comments