Skip to content

Commit cba0761

Browse files
committed
update tests
1 parent 0026e3e commit cba0761

File tree

134 files changed

+409
-207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+409
-207
lines changed

src/test/ui/associated-type-bounds/implied-region-constraints.nll.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ LL | fn _bad_st<'a, 'b, T>(x: St<'a, 'b, T>)
88
...
99
LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0;
1010
| ^^^^^ type annotation requires that `'a` must outlive `'b`
11+
|
12+
= help: consider adding the following bound: `'a: 'b`
1113

1214
error: lifetime may not live long enough
1315
--> $DIR/implied-region-constraints.rs:40:64
@@ -19,6 +21,8 @@ LL | fn _bad_en7<'a, 'b, T>(x: En7<'a, 'b, T>)
1921
...
2022
LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x;
2123
| ^^^^^ type annotation requires that `'a` must outlive `'b`
24+
|
25+
= help: consider adding the following bound: `'a: 'b`
2226

2327
error: aborting due to 2 previous errors
2428

src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.nll.stderr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ LL | fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>(
88
...
99
LL | let z: I::A = if cond { x } else { y };
1010
| ^ assignment requires that `'a` must outlive `'b`
11+
|
12+
= help: consider adding the following bound: `'a: 'b`
1113

1214
error: lifetime may not live long enough
1315
--> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:22:40
@@ -19,6 +21,10 @@ LL | fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>(
1921
...
2022
LL | let z: I::A = if cond { x } else { y };
2123
| ^ assignment requires that `'b` must outlive `'a`
24+
|
25+
= help: consider adding the following bound: `'b: 'a`
26+
27+
help: `'a` and `'b` must be the same: replace one with the other
2228

2329
error: aborting due to 2 previous errors
2430

src/test/ui/associated-types/associated-types-subtyping-1.nll.stderr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ LL | fn method2<'a,'b,T>(x: &'a T, y: &'b T)
88
...
99
LL | let a: <T as Trait<'a>>::Type = make_any();
1010
| ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a`
11+
|
12+
= help: consider adding the following bound: `'b: 'a`
1113

1214
error: lifetime may not live long enough
1315
--> $DIR/associated-types-subtyping-1.rs:35:13
@@ -19,6 +21,8 @@ LL | fn method3<'a,'b,T>(x: &'a T, y: &'b T)
1921
...
2022
LL | let _c: <T as Trait<'a>>::Type = b;
2123
| ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a`
24+
|
25+
= help: consider adding the following bound: `'b: 'a`
2226

2327
error: aborting due to 2 previous errors
2428

src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.nll.stderr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
88
...
99
LL | (a, b)
1010
| ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
11+
|
12+
= help: consider adding the following bound: `'a: 'b`
1113

1214
error: lifetime may not live long enough
1315
--> $DIR/project-fn-ret-contravariant.rs:45:4
@@ -19,6 +21,10 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
1921
...
2022
LL | (a, b)
2123
| ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
24+
|
25+
= help: consider adding the following bound: `'b: 'a`
26+
27+
help: `'a` and `'b` must be the same: replace one with the other
2228

2329
error: aborting due to 2 previous errors
2430

src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.nll.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
55
| -- lifetime `'a` defined here
66
LL | bar(foo, x)
77
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
8+
|
9+
= help: consider replacing `'a` with `'static`
810

911
error: aborting due to previous error
1012

src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.nll.stderr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
88
...
99
LL | (a, b)
1010
| ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
11+
|
12+
= help: consider adding the following bound: `'a: 'b`
1113

1214
error: lifetime may not live long enough
1315
--> $DIR/project-fn-ret-invariant.rs:55:4
@@ -19,6 +21,10 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
1921
...
2022
LL | (a, b)
2123
| ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
24+
|
25+
= help: consider adding the following bound: `'b: 'a`
26+
27+
help: `'a` and `'b` must be the same: replace one with the other
2228

2329
error: aborting due to 2 previous errors
2430

src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.nll.stderr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
88
LL | let f = foo; // <-- No consistent type can be inferred for `f` here.
99
LL | let a = bar(f, x);
1010
| ^^^^^^^^^ argument requires that `'a` must outlive `'b`
11+
|
12+
= help: consider adding the following bound: `'a: 'b`
1113

1214
error: lifetime may not live long enough
1315
--> $DIR/project-fn-ret-invariant.rs:39:12
@@ -19,6 +21,10 @@ LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
1921
...
2022
LL | let b = bar(f, y);
2123
| ^^^^^^^^^ argument requires that `'b` must outlive `'a`
24+
|
25+
= help: consider adding the following bound: `'b: 'a`
26+
27+
help: `'a` and `'b` must be the same: replace one with the other
2228

2329
error: aborting due to 2 previous errors
2430

src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.nll.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
66
...
77
LL | bar(foo, x)
88
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
9+
|
10+
= help: consider replacing `'a` with `'static`
911

1012
error: aborting due to previous error
1113

src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.nll.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ LL | |
1010
LL | | (a, b)
1111
LL | | }
1212
| |_^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
13+
|
14+
= help: consider adding the following bound: `'b: 'a`
1315

1416
error: aborting due to previous error
1517

src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LL | fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> {
77
| lifetime `'a` defined here
88
LL | S { pointer: &mut *p.pointer }
99
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
10+
|
11+
= help: consider adding the following bound: `'a: 'b`
1012

1113
error: aborting due to previous error
1214

0 commit comments

Comments
 (0)