Skip to content

Commit ee89033

Browse files
author
Alexander Regueiro
committedJun 6, 2019
Reblessed tests with NLL compare mode on.
1 parent e37a7a1 commit ee89033

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
error: lifetime may not live long enough
2+
--> $DIR/implied-region-constraints.rs:19:56
3+
|
4+
LL | fn _bad_st<'a, 'b, T>(x: St<'a, 'b, T>)
5+
| -- -- lifetime `'b` defined here
6+
| |
7+
| lifetime `'a` defined here
8+
...
9+
LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0;
10+
| ^^^^^ type annotation requires that `'a` must outlive `'b`
11+
12+
error: lifetime may not live long enough
13+
--> $DIR/implied-region-constraints.rs:40:64
14+
|
15+
LL | fn _bad_en7<'a, 'b, T>(x: En7<'a, 'b, T>)
16+
| -- -- lifetime `'b` defined here
17+
| |
18+
| lifetime `'a` defined here
19+
...
20+
LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x;
21+
| ^^^^^ type annotation requires that `'a` must outlive `'b`
22+
23+
error: aborting due to 2 previous errors
24+

‎src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn elided(x: &i32) -> impl Copy { x }
55
| - ^^^^^^^^^ opaque type requires that `'1` must outlive `'static`
66
| |
77
| let's call the lifetime of this reference `'1`
8-
help: to allow this impl Trait to capture borrowed data with lifetime `'1`, add `'_` as a constraint
8+
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a constraint
99
|
1010
LL | fn elided(x: &i32) -> impl Copy + '_ { x }
1111
| ^^^^^^^^^^^^^^
@@ -17,7 +17,7 @@ LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
1717
| -- ^^^^^^^^^ opaque type requires that `'a` must outlive `'static`
1818
| |
1919
| lifetime `'a` defined here
20-
help: to allow this impl Trait to capture borrowed data with lifetime `'a`, add `'a` as a constraint
20+
help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint
2121
|
2222
LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
2323
| ^^^^^^^^^^^^^^

‎src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
55
| - ^^^^^^^^^^^^^^^^^^^^^^^ opaque type requires that `'1` must outlive `'static`
66
| |
77
| let's call the lifetime of this reference `'1`
8-
help: to allow this impl Trait to capture borrowed data with lifetime `'1`, add `'_` as a constraint
8+
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a constraint
99
|
1010
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -17,7 +17,7 @@ LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
1717
| -- ^^^^^^^^^^^^^^^^^^^^^^^ opaque type requires that `'a` must outlive `'static`
1818
| |
1919
| lifetime `'a` defined here
20-
help: to allow this impl Trait to capture borrowed data with lifetime `'a`, add `'a` as a constraint
20+
help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint
2121
|
2222
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
2323
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)
Please sign in to comment.