fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.9 KiB109 linesraw
1error[E0308]: mismatched types
2  --> $DIR/issue-105675.rs:5:5
3   |
4LL |     thing(f);
5   |     ^^^^^^^^ one type is more general than the other
6   |
7   = note: expected trait `for<'a, 'b> FnOnce<(&'a u32, &'b u32, u32)>`
8              found trait `for<'a> FnOnce<(&u32, &'a u32, u32)>`
9note: this closure does not fulfill the lifetime requirements
10  --> $DIR/issue-105675.rs:4:13
11   |
12LL |     let f = | _ , y: &u32 , z | ();
13   |             ^^^^^^^^^^^^^^^^^^^
14note: the lifetime requirement is introduced here
15  --> $DIR/issue-105675.rs:1:18
16   |
17LL | fn thing(x: impl FnOnce(&u32, &u32, u32)) {}
18   |                  ^^^^^^^^^^^^^^^^^^^^^^^
19help: consider specifying the type of the closure parameters
20   |
21LL |     let f = |_: &_, y: &u32, z| ();
22   |             ~~~~~~~~~~~~~~~~~~~
23
24error[E0308]: mismatched types
25  --> $DIR/issue-105675.rs:5:5
26   |
27LL |     thing(f);
28   |     ^^^^^^^^ one type is more general than the other
29   |
30   = note: expected trait `for<'a, 'b> FnOnce<(&'a u32, &'b u32, u32)>`
31              found trait `for<'a> FnOnce<(&u32, &'a u32, u32)>`
32note: this closure does not fulfill the lifetime requirements
33  --> $DIR/issue-105675.rs:4:13
34   |
35LL |     let f = | _ , y: &u32 , z | ();
36   |             ^^^^^^^^^^^^^^^^^^^
37note: the lifetime requirement is introduced here
38  --> $DIR/issue-105675.rs:1:18
39   |
40LL | fn thing(x: impl FnOnce(&u32, &u32, u32)) {}
41   |                  ^^^^^^^^^^^^^^^^^^^^^^^
42
43error[E0308]: mismatched types
44  --> $DIR/issue-105675.rs:9:5
45   |
46LL |     thing(f);
47   |     ^^^^^^^^ one type is more general than the other
48   |
49   = note: expected trait `for<'a, 'b> FnOnce<(&'a u32, &'b u32, u32)>`
50              found trait `FnOnce<(&u32, &u32, u32)>`
51note: this closure does not fulfill the lifetime requirements
52  --> $DIR/issue-105675.rs:8:13
53   |
54LL |     let f = | x, y: _  , z: u32 | ();
55   |             ^^^^^^^^^^^^^^^^^^^^^
56note: the lifetime requirement is introduced here
57  --> $DIR/issue-105675.rs:1:18
58   |
59LL | fn thing(x: impl FnOnce(&u32, &u32, u32)) {}
60   |                  ^^^^^^^^^^^^^^^^^^^^^^^
61help: consider specifying the type of the closure parameters
62   |
63LL |     let f = |x: &_, y: &_, z: u32| ();
64   |             ~~~~~~~~~~~~~~~~~~~~~~
65
66error[E0308]: mismatched types
67  --> $DIR/issue-105675.rs:9:5
68   |
69LL |     thing(f);
70   |     ^^^^^^^^ one type is more general than the other
71   |
72   = note: expected trait `for<'a, 'b> FnOnce<(&'a u32, &'b u32, u32)>`
73              found trait `FnOnce<(&u32, &u32, u32)>`
74note: this closure does not fulfill the lifetime requirements
75  --> $DIR/issue-105675.rs:8:13
76   |
77LL |     let f = | x, y: _  , z: u32 | ();
78   |             ^^^^^^^^^^^^^^^^^^^^^
79note: the lifetime requirement is introduced here
80  --> $DIR/issue-105675.rs:1:18
81   |
82LL | fn thing(x: impl FnOnce(&u32, &u32, u32)) {}
83   |                  ^^^^^^^^^^^^^^^^^^^^^^^
84help: consider specifying the type of the closure parameters
85   |
86LL |     let f = |x: &_, y: &_, z: u32| ();
87   |             ~~~~~~~~~~~~~~~~~~~~~~
88
89error: implementation of `FnOnce` is not general enough
90  --> $DIR/issue-105675.rs:9:5
91   |
92LL |     thing(f);
93   |     ^^^^^^^^ implementation of `FnOnce` is not general enough
94   |
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`
97
98error: implementation of `FnOnce` is not general enough
99  --> $DIR/issue-105675.rs:9:5
100   |
101LL |     thing(f);
102   |     ^^^^^^^^ implementation of `FnOnce` is not general enough
103   |
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`
106
107error: aborting due to 6 previous errors
108
109For more information about this error, try `rustc --explain E0308`.