]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/outlives-suggestion-simple.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / nll / outlives-suggestion-simple.stderr
CommitLineData
60c5eb7d 1error: lifetime may not live long enough
923072b8 2 --> $DIR/outlives-suggestion-simple.rs:4:5
60c5eb7d
XL
3 |
4LL | fn foo1<'a, 'b>(x: &'a usize) -> &'b usize {
5 | -- -- lifetime `'b` defined here
6 | |
7 | lifetime `'a` defined here
8LL | x
5099ac24 9 | ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
60c5eb7d
XL
10 |
11 = help: consider adding the following bound: `'a: 'b`
12
13error: lifetime may not live long enough
923072b8 14 --> $DIR/outlives-suggestion-simple.rs:8:5
60c5eb7d
XL
15 |
16LL | fn foo2<'a>(x: &'a usize) -> &'static usize {
17 | -- lifetime `'a` defined here
18LL | x
19 | ^ returning this value requires that `'a` must outlive `'static`
60c5eb7d
XL
20
21error: lifetime may not live long enough
923072b8 22 --> $DIR/outlives-suggestion-simple.rs:12:5
60c5eb7d
XL
23 |
24LL | fn foo3<'a, 'b>(x: &'a usize, y: &'b usize) -> (&'b usize, &'a usize) {
25 | -- -- lifetime `'b` defined here
26 | |
27 | lifetime `'a` defined here
28LL | (x, y)
29 | ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
30 |
31 = help: consider adding the following bound: `'a: 'b`
32
33error: lifetime may not live long enough
923072b8 34 --> $DIR/outlives-suggestion-simple.rs:12:5
60c5eb7d
XL
35 |
36LL | fn foo3<'a, 'b>(x: &'a usize, y: &'b usize) -> (&'b usize, &'a usize) {
37 | -- -- lifetime `'b` defined here
38 | |
39 | lifetime `'a` defined here
40LL | (x, y)
41 | ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
42 |
43 = help: consider adding the following bound: `'b: 'a`
44
45help: `'a` and `'b` must be the same: replace one with the other
46
47error: lifetime may not live long enough
923072b8 48 --> $DIR/outlives-suggestion-simple.rs:20:5
60c5eb7d
XL
49 |
50LL | fn foo4<'a, 'b, 'c>(x: &'a usize) -> (&'b usize, &'c usize) {
51 | -- -- lifetime `'b` defined here
52 | |
53 | lifetime `'a` defined here
54...
55LL | (x, x)
5099ac24 56 | ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
60c5eb7d
XL
57 |
58 = help: consider adding the following bound: `'a: 'b`
59
60error: lifetime may not live long enough
923072b8 61 --> $DIR/outlives-suggestion-simple.rs:29:9
60c5eb7d
XL
62 |
63LL | pub fn foo<'a>(x: &'a usize) -> Self {
64 | -- lifetime `'a` defined here
65LL | Foo { x }
66 | ^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
60c5eb7d
XL
67
68error: lifetime may not live long enough
923072b8 69 --> $DIR/outlives-suggestion-simple.rs:39:9
60c5eb7d
XL
70 |
71LL | impl<'a> Bar<'a> {
72 | -- lifetime `'a` defined here
73LL | pub fn get<'b>(&self) -> &'b usize {
74 | -- lifetime `'b` defined here
75LL | self.x
5099ac24 76 | ^^^^^^ associated function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
60c5eb7d
XL
77 |
78 = help: consider adding the following bound: `'a: 'b`
79
80error: lifetime may not live long enough
923072b8 81 --> $DIR/outlives-suggestion-simple.rs:50:9
60c5eb7d
XL
82 |
83LL | impl<'a> Baz<'a> {
84 | -- lifetime `'a` defined here
85LL | fn get<'b>(&'b self) -> &'a i32 {
86 | -- lifetime `'b` defined here
87LL | self.x
5099ac24 88 | ^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
60c5eb7d
XL
89 |
90 = help: consider adding the following bound: `'b: 'a`
91
5099ac24 92error: lifetime may not live long enough
923072b8 93 --> $DIR/outlives-suggestion-simple.rs:71:9
60c5eb7d 94 |
c295e0f8
XL
95LL | impl<'a> Foo2<'a> {
96 | -- lifetime `'a` defined here
97LL | // should not produce outlives suggestions to name 'self
60c5eb7d 98LL | fn get_bar(&self) -> Bar2 {
5099ac24 99 | - let's call the lifetime of this reference `'1`
60c5eb7d 100LL | Bar2::new(&self)
5099ac24 101 | ^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'a`
60c5eb7d
XL
102
103error: aborting due to 9 previous errors
104