]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/lifetimes/issue-105544.stderr
Rollup merge of #107255 - lcnr:implied-b-hr, r=oli-obk
[rust.git] / tests / ui / suggestions / lifetimes / issue-105544.stderr
1 error[E0311]: the parameter type `impl Sized` may not live long enough
2   --> $DIR/issue-105544.rs:7:5
3    |
4 LL |     (d, p)
5    |     ^^^^^^
6    |
7 note: the parameter type `impl Sized` must be valid for the anonymous lifetime defined here...
8   --> $DIR/issue-105544.rs:5:26
9    |
10 LL | fn foo(d: impl Sized, p: &mut ()) -> impl Sized + '_ {
11    |                          ^^^^^^^
12 note: ...so that the type `impl Sized` will meet its required lifetime bounds
13   --> $DIR/issue-105544.rs:7:5
14    |
15 LL |     (d, p)
16    |     ^^^^^^
17 help: consider adding an explicit lifetime bound...
18    |
19 LL | fn foo<'a>(d: impl Sized + 'a, p: &'a mut ()) -> impl Sized + '_ {
20    |       ++++               ++++      ++
21
22 error[E0309]: the parameter type `impl Sized` may not live long enough
23   --> $DIR/issue-105544.rs:14:5
24    |
25 LL |     (d, p)
26    |     ^^^^^^ ...so that the type `impl Sized` will meet its required lifetime bounds
27    |
28 help: consider adding an explicit lifetime bound...
29    |
30 LL | fn foo1<'b>(d: impl Sized + 'b, p: &'b mut ()) -> impl Sized + '_ {
31    |                           ++++
32
33 error[E0311]: the parameter type `impl Sized + 'a` may not live long enough
34   --> $DIR/issue-105544.rs:20:5
35    |
36 LL |     (d, p)
37    |     ^^^^^^
38    |
39 note: the parameter type `impl Sized + 'a` must be valid for the anonymous lifetime defined here...
40   --> $DIR/issue-105544.rs:18:36
41    |
42 LL | fn foo2<'a>(d: impl Sized + 'a, p: &mut ()) -> impl Sized + '_ {
43    |                                    ^^^^^^^
44 note: ...so that the type `impl Sized + 'a` will meet its required lifetime bounds
45   --> $DIR/issue-105544.rs:20:5
46    |
47 LL |     (d, p)
48    |     ^^^^^^
49 help: consider adding an explicit lifetime bound...
50    |
51 LL | fn foo2<'b, 'a>(d: impl Sized + 'a + 'b, p: &'b mut ()) -> impl Sized + '_ {
52    |         +++                        ++++      ++
53
54 error[E0311]: the parameter type `T` may not live long enough
55   --> $DIR/issue-105544.rs:27:5
56    |
57 LL |     (d, p)
58    |     ^^^^^^
59    |
60 note: the parameter type `T` must be valid for the anonymous lifetime defined here...
61   --> $DIR/issue-105544.rs:25:28
62    |
63 LL | fn bar<T : Sized>(d: T, p: & mut ()) -> impl Sized + '_ {
64    |                            ^^^^^^^^
65 note: ...so that the type `T` will meet its required lifetime bounds
66   --> $DIR/issue-105544.rs:27:5
67    |
68 LL |     (d, p)
69    |     ^^^^^^
70 help: consider adding an explicit lifetime bound...
71    |
72 LL | fn bar<'a, T : Sized + 'a>(d: T, p: &'a mut ()) -> impl Sized + '_ {
73    |        +++           ++++            ++
74
75 error[E0309]: the parameter type `T` may not live long enough
76   --> $DIR/issue-105544.rs:34:5
77    |
78 LL |     (d, p)
79    |     ^^^^^^ ...so that the type `T` will meet its required lifetime bounds
80    |
81 help: consider adding an explicit lifetime bound...
82    |
83 LL | fn bar1<'b, T : Sized + 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ {
84    |                       ++++
85
86 error[E0311]: the parameter type `T` may not live long enough
87   --> $DIR/issue-105544.rs:40:5
88    |
89 LL |     (d, p)
90    |     ^^^^^^
91    |
92 note: the parameter type `T` must be valid for the anonymous lifetime defined here...
93   --> $DIR/issue-105544.rs:38:38
94    |
95 LL | fn bar2<'a, T : Sized + 'a>(d: T, p: &mut ()) -> impl Sized + '_ {
96    |                                      ^^^^^^^
97 note: ...so that the type `T` will meet its required lifetime bounds
98   --> $DIR/issue-105544.rs:40:5
99    |
100 LL |     (d, p)
101    |     ^^^^^^
102 help: consider adding an explicit lifetime bound...
103    |
104 LL | fn bar2<'b, 'a, T : Sized + 'a + 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ {
105    |         +++                    ++++            ++
106
107 error: aborting due to 6 previous errors
108
109 Some errors have detailed explanations: E0309, E0311.
110 For more information about an error, try `rustc --explain E0309`.