]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-infer-not-param.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / regions / regions-infer-not-param.stderr
1 error[E0308]: mismatched types
2   --> $DIR/regions-infer-not-param.rs:25:54
3    |
4 LL | fn take_direct<'a,'b>(p: direct<'a>) -> direct<'b> { p } //~ ERROR mismatched types
5    |                                                      ^ lifetime mismatch
6    |
7    = note: expected type `direct<'b>`
8               found type `direct<'a>`
9 note: the lifetime 'a as defined on the function body at 25:16...
10   --> $DIR/regions-infer-not-param.rs:25:16
11    |
12 LL | fn take_direct<'a,'b>(p: direct<'a>) -> direct<'b> { p } //~ ERROR mismatched types
13    |                ^^
14 note: ...does not necessarily outlive the lifetime 'b as defined on the function body at 25:19
15   --> $DIR/regions-infer-not-param.rs:25:19
16    |
17 LL | fn take_direct<'a,'b>(p: direct<'a>) -> direct<'b> { p } //~ ERROR mismatched types
18    |                   ^^
19
20 error[E0308]: mismatched types
21   --> $DIR/regions-infer-not-param.rs:29:63
22    |
23 LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types
24    |                                                               ^ lifetime mismatch
25    |
26    = note: expected type `indirect2<'b>`
27               found type `indirect2<'a>`
28 note: the lifetime 'a as defined on the function body at 29:19...
29   --> $DIR/regions-infer-not-param.rs:29:19
30    |
31 LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types
32    |                   ^^
33 note: ...does not necessarily outlive the lifetime 'b as defined on the function body at 29:22
34   --> $DIR/regions-infer-not-param.rs:29:22
35    |
36 LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types
37    |                      ^^
38
39 error[E0308]: mismatched types
40   --> $DIR/regions-infer-not-param.rs:29:63
41    |
42 LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types
43    |                                                               ^ lifetime mismatch
44    |
45    = note: expected type `indirect2<'b>`
46               found type `indirect2<'a>`
47 note: the lifetime 'b as defined on the function body at 29:22...
48   --> $DIR/regions-infer-not-param.rs:29:22
49    |
50 LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types
51    |                      ^^
52 note: ...does not necessarily outlive the lifetime 'a as defined on the function body at 29:19
53   --> $DIR/regions-infer-not-param.rs:29:19
54    |
55 LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types
56    |                   ^^
57
58 error: aborting due to 3 previous errors
59
60 For more information about this error, try `rustc --explain E0308`.