Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 383fbee

Browse files
committedMay 22, 2022
Use revisions for NLL in lifetimes
1 parent fe91cfd commit 383fbee

File tree

108 files changed

+398
-145
lines changed

Some content is hidden

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

108 files changed

+398
-145
lines changed
 

‎src/test/ui/lifetimes/issue-79187-2.stderr renamed to ‎src/test/ui/lifetimes/issue-79187-2.base.stderr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11
error[E0308]: mismatched types
2-
--> $DIR/issue-79187-2.rs:8:5
2+
--> $DIR/issue-79187-2.rs:12:5
33
|
44
LL | take_foo(|a| a);
55
| ^^^^^^^^ lifetime mismatch
66
|
77
= note: expected type `for<'r> Fn<(&'r i32,)>`
88
found type `Fn<(&i32,)>`
99
note: this closure does not fulfill the lifetime requirements
10-
--> $DIR/issue-79187-2.rs:8:14
10+
--> $DIR/issue-79187-2.rs:12:14
1111
|
1212
LL | take_foo(|a| a);
1313
| ^^^^^
1414
note: the lifetime requirement is introduced here
15-
--> $DIR/issue-79187-2.rs:5:21
15+
--> $DIR/issue-79187-2.rs:9:21
1616
|
1717
LL | fn take_foo(_: impl Foo) {}
1818
| ^^^
1919

2020
error[E0308]: mismatched types
21-
--> $DIR/issue-79187-2.rs:9:5
21+
--> $DIR/issue-79187-2.rs:16:5
2222
|
2323
LL | take_foo(|a: &i32| a);
2424
| ^^^^^^^^ lifetime mismatch
2525
|
2626
= note: expected reference `&i32`
2727
found reference `&i32`
2828
note: the anonymous lifetime #1 defined here doesn't meet the lifetime requirements
29-
--> $DIR/issue-79187-2.rs:9:14
29+
--> $DIR/issue-79187-2.rs:16:14
3030
|
3131
LL | take_foo(|a: &i32| a);
3232
| ^^^^^^^^^^^
3333
note: the lifetime requirement is introduced here
34-
--> $DIR/issue-79187-2.rs:5:21
34+
--> $DIR/issue-79187-2.rs:9:21
3535
|
3636
LL | fn take_foo(_: impl Foo) {}
3737
| ^^^
3838

3939
error[E0308]: mismatched types
40-
--> $DIR/issue-79187-2.rs:10:5
40+
--> $DIR/issue-79187-2.rs:20:5
4141
|
4242
LL | take_foo(|a: &i32| -> &i32 { a });
4343
| ^^^^^^^^ lifetime mismatch
4444
|
4545
= note: expected reference `&i32`
4646
found reference `&i32`
4747
note: the anonymous lifetime #1 defined here doesn't meet the lifetime requirements
48-
--> $DIR/issue-79187-2.rs:10:14
48+
--> $DIR/issue-79187-2.rs:20:14
4949
|
5050
LL | take_foo(|a: &i32| -> &i32 { a });
5151
| ^^^^^^^^^^^^^^^^^^^^^^^
5252
note: the lifetime requirement is introduced here
53-
--> $DIR/issue-79187-2.rs:5:21
53+
--> $DIR/issue-79187-2.rs:9:21
5454
|
5555
LL | fn take_foo(_: impl Foo) {}
5656
| ^^^

‎src/test/ui/lifetimes/issue-79187-2.nll.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/issue-79187-2.rs:9:24
2+
--> $DIR/issue-79187-2.rs:16:24
33
|
44
LL | take_foo(|a: &i32| a);
55
| - - ^ returning this value requires that `'1` must outlive `'2`
@@ -8,7 +8,7 @@ LL | take_foo(|a: &i32| a);
88
| let's call the lifetime of this reference `'1`
99

1010
error: lifetime may not live long enough
11-
--> $DIR/issue-79187-2.rs:10:34
11+
--> $DIR/issue-79187-2.rs:20:34
1212
|
1313
LL | take_foo(|a: &i32| -> &i32 { a });
1414
| - - ^ returning this value requires that `'1` must outlive `'2`
@@ -17,7 +17,7 @@ LL | take_foo(|a: &i32| -> &i32 { a });
1717
| let's call the lifetime of this reference `'1`
1818

1919
error: implementation of `FnOnce` is not general enough
20-
--> $DIR/issue-79187-2.rs:8:5
20+
--> $DIR/issue-79187-2.rs:12:5
2121
|
2222
LL | take_foo(|a| a);
2323
| ^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
@@ -26,48 +26,48 @@ LL | take_foo(|a| a);
2626
= note: ...but it actually implements `FnOnce<(&'2 i32,)>`, for some specific lifetime `'2`
2727

2828
error[E0308]: mismatched types
29-
--> $DIR/issue-79187-2.rs:8:5
29+
--> $DIR/issue-79187-2.rs:12:5
3030
|
3131
LL | take_foo(|a| a);
3232
| ^^^^^^^^^^^^^^^ one type is more general than the other
3333
|
3434
= note: expected type `for<'r> Fn<(&'r i32,)>`
3535
found type `Fn<(&i32,)>`
3636
note: this closure does not fulfill the lifetime requirements
37-
--> $DIR/issue-79187-2.rs:8:14
37+
--> $DIR/issue-79187-2.rs:12:14
3838
|
3939
LL | take_foo(|a| a);
4040
| ^^^^^
4141
note: the lifetime requirement is introduced here
42-
--> $DIR/issue-79187-2.rs:5:21
42+
--> $DIR/issue-79187-2.rs:9:21
4343
|
4444
LL | fn take_foo(_: impl Foo) {}
4545
| ^^^
4646

4747
error[E0308]: mismatched types
48-
--> $DIR/issue-79187-2.rs:9:5
48+
--> $DIR/issue-79187-2.rs:16:5
4949
|
5050
LL | take_foo(|a: &i32| a);
5151
| ^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
5252
|
5353
= note: expected reference `&i32`
5454
found reference `&i32`
5555
note: the lifetime requirement is introduced here
56-
--> $DIR/issue-79187-2.rs:5:21
56+
--> $DIR/issue-79187-2.rs:9:21
5757
|
5858
LL | fn take_foo(_: impl Foo) {}
5959
| ^^^
6060

6161
error[E0308]: mismatched types
62-
--> $DIR/issue-79187-2.rs:10:5
62+
--> $DIR/issue-79187-2.rs:20:5
6363
|
6464
LL | take_foo(|a: &i32| -> &i32 { a });
6565
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
6666
|
6767
= note: expected reference `&i32`
6868
found reference `&i32`
6969
note: the lifetime requirement is introduced here
70-
--> $DIR/issue-79187-2.rs:5:21
70+
--> $DIR/issue-79187-2.rs:9:21
7171
|
7272
LL | fn take_foo(_: impl Foo) {}
7373
| ^^^

0 commit comments

Comments
 (0)
Please sign in to comment.