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

error[E0308]: mismatched types
  --> $DIR/issue-105675.rs:5:5
   |
LL |     thing(f);
   |     ^^^^^^^^ one type is more general than the other
   |
   = note: expected trait `for<'a, 'b> FnOnce(&'a u32, &'b u32, u32)`
              found trait `for<'a> FnOnce(&u32, &'a u32, u32)`
note: this closure does not fulfill the lifetime requirements
  --> $DIR/issue-105675.rs:4:13
   |
LL |     let f = | _ , y: &u32 , z | ();
   |             ^^^^^^^^^^^^^^^^^^^
note: the lifetime requirement is introduced here
  --> $DIR/issue-105675.rs:1:18
   |
LL | fn thing(x: impl FnOnce(&u32, &u32, u32)) {}
   |                  ^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> $DIR/issue-105675.rs:9:5
   |
LL |     thing(f);
   |     ^^^^^^^^ one type is more general than the other
   |
   = note: expected trait `for<'a, 'b> FnOnce(&'a u32, &'b u32, u32)`
              found trait `FnOnce(&u32, &u32, u32)`
note: this closure does not fulfill the lifetime requirements
  --> $DIR/issue-105675.rs:8:13
   |
LL |     let f = | x, y: _  , z: u32 | ();
   |             ^^^^^^^^^^^^^^^^^^^^^
note: the lifetime requirement is introduced here
  --> $DIR/issue-105675.rs:1:18
   |
LL | fn thing(x: impl FnOnce(&u32, &u32, u32)) {}
   |                  ^^^^^^^^^^^^^^^^^^^^^^^
help: consider specifying the type of the closure parameters
   |
LL |     let f = |x: &_, y: &_, z: u32| ();
   |             ~~~~~~~~~~~~~~~~~~~~~~

error[E0308]: mismatched types
  --> $DIR/issue-105675.rs:9:5
   |
LL |     thing(f);
   |     ^^^^^^^^ one type is more general than the other
   |
   = note: expected trait `for<'a, 'b> FnOnce(&'a u32, &'b u32, u32)`
              found trait `FnOnce(&u32, &u32, u32)`
note: this closure does not fulfill the lifetime requirements
  --> $DIR/issue-105675.rs:8:13
   |
LL |     let f = | x, y: _  , z: u32 | ();
   |             ^^^^^^^^^^^^^^^^^^^^^
note: the lifetime requirement is introduced here
  --> $DIR/issue-105675.rs:1:18
   |
LL | fn thing(x: impl FnOnce(&u32, &u32, u32)) {}
   |                  ^^^^^^^^^^^^^^^^^^^^^^^
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: consider specifying the type of the closure parameters
   |
LL |     let f = |x: &_, y: &_, z: u32| ();
   |             ~~~~~~~~~~~~~~~~~~~~~~

error: implementation of `FnOnce` is not general enough
  --> $DIR/issue-105675.rs:9:5
   |
LL |     thing(f);
   |     ^^^^^^^^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&'2 u32, &u32, u32)` must implement `FnOnce<(&'1 u32, &u32, u32)>`, for any lifetime `'1`...
   = note: ...but it actually implements `FnOnce<(&'2 u32, &u32, u32)>`, for some specific lifetime `'2`

error: implementation of `FnOnce` is not general enough
  --> $DIR/issue-105675.rs:9:5
   |
LL |     thing(f);
   |     ^^^^^^^^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&u32, &'2 u32, u32)` must implement `FnOnce<(&u32, &'1 u32, u32)>`, for any lifetime `'1`...
   = note: ...but it actually implements `FnOnce<(&u32, &'2 u32, u32)>`, for some specific lifetime `'2`

error: aborting due to 6 previous errors

For more information about this error, try `rustc --explain E0308`.