summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/lifetimes/issue-105544.stderr
blob: 553643c0c3f7041d90520bd69088ea4f4b195d43 (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
error[E0311]: the parameter type `impl Sized` may not live long enough
  --> $DIR/issue-105544.rs:7:5
   |
LL | fn foo(d: impl Sized, p: &mut ()) -> impl Sized + '_ {
   |                          ------- the parameter type `impl Sized` must be valid for the anonymous lifetime defined here...
LL |
LL |     (d, p)
   |     ^^^^^^ ...so that the type `impl Sized` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL | fn foo<'a>(d: impl Sized + 'a, p: &'a mut ()) -> impl Sized + 'a {
   |       ++++               ++++      ++                         ~~

error[E0309]: the parameter type `impl Sized` may not live long enough
  --> $DIR/issue-105544.rs:15:5
   |
LL | fn foo1<'b>(d: impl Sized, p: &'b mut ()) -> impl Sized + '_ {
   |         -- the parameter type `impl Sized` must be valid for the lifetime `'b` as defined here...
...
LL |     (d, p)
   |     ^^^^^^ ...so that the type `impl Sized` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL | fn foo1<'b>(d: impl Sized + 'b, p: &'b mut ()) -> impl Sized + '_ {
   |                           ++++

error[E0311]: the parameter type `impl Sized + 'a` may not live long enough
  --> $DIR/issue-105544.rs:21:5
   |
LL | fn foo2<'a>(d: impl Sized + 'a, p: &mut ()) -> impl Sized + '_ {
   |                                    ------- the parameter type `impl Sized + 'a` must be valid for the anonymous lifetime defined here...
LL |
LL |     (d, p)
   |     ^^^^^^ ...so that the type `impl Sized + 'a` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL | fn foo2<'b, 'a>(d: impl Sized + 'a + 'b, p: &'b mut ()) -> impl Sized + 'b {
   |         +++                        ++++      ++                         ~~

error[E0311]: the parameter type `T` may not live long enough
  --> $DIR/issue-105544.rs:28:5
   |
LL | fn bar<T : Sized>(d: T, p: & mut ()) -> impl Sized + '_ {
   |                            -------- the parameter type `T` must be valid for the anonymous lifetime defined here...
LL |
LL |     (d, p)
   |     ^^^^^^ ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL | fn bar<'a, T : Sized + 'a>(d: T, p: &'a  mut ()) -> impl Sized + 'a {
   |        +++           ++++            ++                          ~~

error[E0309]: the parameter type `T` may not live long enough
  --> $DIR/issue-105544.rs:36:5
   |
LL | fn bar1<'b, T : Sized>(d: T, p: &'b mut ()) -> impl Sized + '_ {
   |         -- the parameter type `T` must be valid for the lifetime `'b` as defined here...
...
LL |     (d, p)
   |     ^^^^^^ ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL | fn bar1<'b, T : Sized + 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ {
   |                       ++++

error[E0311]: the parameter type `T` may not live long enough
  --> $DIR/issue-105544.rs:42:5
   |
LL | fn bar2<'a, T : Sized + 'a>(d: T, p: &mut ()) -> impl Sized + '_ {
   |                                      ------- the parameter type `T` must be valid for the anonymous lifetime defined here...
LL |
LL |     (d, p)
   |     ^^^^^^ ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL | fn bar2<'b, 'a, T : Sized + 'a + 'b>(d: T, p: &'b mut ()) -> impl Sized + 'b {
   |         +++                    ++++            ++                         ~~

error: aborting due to 6 previous errors

Some errors have detailed explanations: E0309, E0311.
For more information about an error, try `rustc --explain E0309`.