Skip to content

Commit 9434d6b

Browse files
committed
update some tests
1 parent 7a6361f commit 9434d6b

22 files changed

+77
-77
lines changed

src/test/ui/async-await/issues/issue-62097.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ help: to force the closure to take ownership of `self` (and any other referenced
1616
LL | foo(move || self.bar()).await;
1717
| ^^^^^^^
1818

19-
error[E0521]: borrowed data escapes outside of function
19+
error[E0521]: borrowed data escapes outside of method
2020
--> $DIR/issue-62097.rs:13:9
2121
|
2222
LL | pub async fn run_dummy_fn(&self) {
23-
| ----- `self` is a reference that is only valid in the function body
23+
| ----- `self` is a reference that is only valid in the method body
2424
LL | foo(|| self.bar()).await;
25-
| ^^^^^^^^^^^^^^^^^^ `self` escapes the function body here
25+
| ^^^^^^^^^^^^^^^^^^ `self` escapes the method body here
2626

2727
error: aborting due to 2 previous errors
2828

src/test/ui/async-await/issues/issue-63388-1.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | ) -> &dyn Foo
99
LL | / {
1010
LL | | foo
1111
LL | | }
12-
| |_____^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
12+
| |_____^ method was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
1313

1414
error: aborting due to previous error
1515

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error[E0521]: borrowed data escapes outside of function
1+
error[E0521]: borrowed data escapes outside of method
22
--> $DIR/issue-16683.rs:4:9
33
|
44
LL | fn b(&self) {
5-
| ----- `self` is a reference that is only valid in the function body
5+
| ----- `self` is a reference that is only valid in the method body
66
LL | self.a();
7-
| ^^^^^^^^ `self` escapes the function body here
7+
| ^^^^^^^^ `self` escapes the method body here
88

99
error: aborting due to previous error
1010

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error[E0521]: borrowed data escapes outside of function
1+
error[E0521]: borrowed data escapes outside of method
22
--> $DIR/issue-17758.rs:7:9
33
|
44
LL | fn bar(&self) {
5-
| ----- `self` is a reference that is only valid in the function body
5+
| ----- `self` is a reference that is only valid in the method body
66
LL | self.foo();
7-
| ^^^^^^^^^^ `self` escapes the function body here
7+
| ^^^^^^^^^^ `self` escapes the method body here
88

99
error: aborting due to previous error
1010

src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
77
| lifetime `'a` defined here
88
LL |
99
LL | if x > y { x } else { y }
10-
| ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
10+
| ^ method was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
1111

1212
error: aborting due to previous error
1313

src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | fn foo<'a>(&self, x: &'a i32) -> &i32 {
77
| lifetime `'a` defined here
88
LL |
99
LL | x
10-
| ^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
10+
| ^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
1111

1212
error: aborting due to previous error
1313

src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
77
| lifetime `'a` defined here
88
LL |
99
LL | if true { x } else { self }
10-
| ^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
10+
| ^^^^ method was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
1111

1212
error: aborting due to previous error
1313

src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | fn foo<'a>(&self, x: &i32) -> &i32 {
66
| |
77
| let's call the lifetime of this reference `'2`
88
LL | x
9-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
9+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
1010

1111
error: aborting due to previous error
1212

src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | fn foo<'a>(&self, x: &Foo) -> &Foo {
66
| |
77
| let's call the lifetime of this reference `'2`
88
LL | if true { x } else { self }
9-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
9+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
1010

1111
error: aborting due to previous error
1212

src/test/ui/nll/outlives-suggestion-simple.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub struct Foo2<'a> {
7070
impl<'a> Foo2<'a> {
7171
// should not produce outlives suggestions to name 'self
7272
fn get_bar(&self) -> Bar2 {
73-
Bar2::new(&self) //~ERROR borrowed data escapes outside of function
73+
Bar2::new(&self) //~ERROR borrowed data escapes outside of method
7474
}
7575
}
7676

src/test/ui/nll/outlives-suggestion-simple.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,16 @@ LL | self.x
9393
|
9494
= help: consider adding the following bound: `'b: 'a`
9595

96-
error[E0521]: borrowed data escapes outside of function
96+
error[E0521]: borrowed data escapes outside of method
9797
--> $DIR/outlives-suggestion-simple.rs:73:9
9898
|
9999
LL | fn get_bar(&self) -> Bar2 {
100100
| -----
101101
| |
102-
| `self` declared here, outside of the function body
103-
| `self` is a reference that is only valid in the function body
102+
| `self` declared here, outside of the method body
103+
| `self` is a reference that is only valid in the method body
104104
LL | Bar2::new(&self)
105-
| ^^^^^^^^^^^^^^^^ `self` escapes the function body here
105+
| ^^^^^^^^^^^^^^^^ `self` escapes the method body here
106106

107107
error: aborting due to 9 previous errors
108108

src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: lifetime may not live long enough
22
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:8:52
33
|
44
LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
5-
| - - ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
5+
| - - ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
66
| | |
77
| | let's call the lifetime of this reference `'1`
88
| let's call the lifetime of this reference `'2`
@@ -11,7 +11,7 @@ error: lifetime may not live long enough
1111
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:75
1212
|
1313
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
14-
| - - ^^^^^^^^^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
14+
| - - ^^^^^^^^^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
1515
| | |
1616
| | let's call the lifetime of this reference `'1`
1717
| let's call the lifetime of this reference `'2`
@@ -20,7 +20,7 @@ error: lifetime may not live long enough
2020
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:17:64
2121
|
2222
LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
23-
| -- - ^^^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
23+
| -- - ^^^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
2424
| | |
2525
| | let's call the lifetime of this reference `'1`
2626
| lifetime `'a` defined here

src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: lifetime may not live long enough
22
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:6:46
33
|
44
LL | fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
5-
| - - ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
5+
| - - ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
66
| | |
77
| | let's call the lifetime of this reference `'1`
88
| let's call the lifetime of this reference `'2`
@@ -11,7 +11,7 @@ error: lifetime may not live long enough
1111
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:8:69
1212
|
1313
LL | fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
14-
| - - ^^^^^^^^^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
14+
| - - ^^^^^^^^^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
1515
| | |
1616
| | let's call the lifetime of this reference `'1`
1717
| let's call the lifetime of this reference `'2`
@@ -20,7 +20,7 @@ error: lifetime may not live long enough
2020
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:13:58
2121
|
2222
LL | fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
23-
| -- ---- has type `std::pin::Pin<&'1 Foo>` ^^^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
23+
| -- ---- has type `std::pin::Pin<&'1 Foo>` ^^^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
2424
| |
2525
| lifetime `'a` defined here
2626

src/test/ui/self/elision/lt-ref-self-async.nll.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | async fn ref_self(&self, f: &u32) -> &u32 {
66
| |
77
| let's call the lifetime of this reference `'2`
88
LL | f
9-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
9+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
1010

1111
error: lifetime may not live long enough
1212
--> $DIR/lt-ref-self-async.rs:19:9
@@ -16,7 +16,7 @@ LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 {
1616
| |
1717
| let's call the lifetime of this reference `'2`
1818
LL | f
19-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
19+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
2020

2121
error: lifetime may not live long enough
2222
--> $DIR/lt-ref-self-async.rs:23:9
@@ -26,7 +26,7 @@ LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
2626
| |
2727
| let's call the lifetime of this reference `'2`
2828
LL | f
29-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
29+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
3030

3131
error: lifetime may not live long enough
3232
--> $DIR/lt-ref-self-async.rs:27:9
@@ -36,7 +36,7 @@ LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
3636
| |
3737
| let's call the lifetime of this reference `'2`
3838
LL | f
39-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
39+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
4040

4141
error: lifetime may not live long enough
4242
--> $DIR/lt-ref-self-async.rs:31:9
@@ -46,7 +46,7 @@ LL | async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
4646
| |
4747
| let's call the lifetime of this reference `'2`
4848
LL | f
49-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
49+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
5050

5151
error: lifetime may not live long enough
5252
--> $DIR/lt-ref-self-async.rs:35:9
@@ -56,7 +56,7 @@ LL | async fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
5656
| |
5757
| let's call the lifetime of this reference `'2`
5858
LL | f
59-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
59+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
6060

6161
error: aborting due to 6 previous errors
6262

src/test/ui/self/elision/lt-ref-self.nll.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | fn ref_self(&self, f: &u32) -> &u32 {
66
| |
77
| let's call the lifetime of this reference `'2`
88
LL | f
9-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
9+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
1010

1111
error: lifetime may not live long enough
1212
--> $DIR/lt-ref-self.rs:17:9
@@ -16,7 +16,7 @@ LL | fn ref_Self(self: &Self, f: &u32) -> &u32 {
1616
| |
1717
| let's call the lifetime of this reference `'2`
1818
LL | f
19-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
19+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
2020

2121
error: lifetime may not live long enough
2222
--> $DIR/lt-ref-self.rs:21:9
@@ -26,7 +26,7 @@ LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
2626
| |
2727
| let's call the lifetime of this reference `'2`
2828
LL | f
29-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
29+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
3030

3131
error: lifetime may not live long enough
3232
--> $DIR/lt-ref-self.rs:25:9
@@ -36,7 +36,7 @@ LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
3636
| |
3737
| let's call the lifetime of this reference `'2`
3838
LL | f
39-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
39+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
4040

4141
error: lifetime may not live long enough
4242
--> $DIR/lt-ref-self.rs:29:9
@@ -46,7 +46,7 @@ LL | fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
4646
| |
4747
| let's call the lifetime of this reference `'2`
4848
LL | f
49-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
49+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
5050

5151
error: lifetime may not live long enough
5252
--> $DIR/lt-ref-self.rs:33:9
@@ -56,7 +56,7 @@ LL | fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
5656
| |
5757
| let's call the lifetime of this reference `'2`
5858
LL | f
59-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
59+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
6060

6161
error: aborting due to 6 previous errors
6262

src/test/ui/self/elision/ref-mut-self-async.nll.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | async fn ref_self(&mut self, f: &u32) -> &u32 {
66
| |
77
| let's call the lifetime of this reference `'2`
88
LL | f
9-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
9+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
1010

1111
error: lifetime may not live long enough
1212
--> $DIR/ref-mut-self-async.rs:19:9
@@ -16,7 +16,7 @@ LL | async fn ref_Self(self: &mut Self, f: &u32) -> &u32 {
1616
| |
1717
| let's call the lifetime of this reference `'2`
1818
LL | f
19-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
19+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
2020

2121
error: lifetime may not live long enough
2222
--> $DIR/ref-mut-self-async.rs:23:9
@@ -26,7 +26,7 @@ LL | async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 {
2626
| |
2727
| let's call the lifetime of this reference `'2`
2828
LL | f
29-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
29+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
3030

3131
error: lifetime may not live long enough
3232
--> $DIR/ref-mut-self-async.rs:27:9
@@ -36,7 +36,7 @@ LL | async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 {
3636
| |
3737
| let's call the lifetime of this reference `'2`
3838
LL | f
39-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
39+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
4040

4141
error: lifetime may not live long enough
4242
--> $DIR/ref-mut-self-async.rs:31:9
@@ -46,7 +46,7 @@ LL | async fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 {
4646
| |
4747
| let's call the lifetime of this reference `'2`
4848
LL | f
49-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
49+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
5050

5151
error: lifetime may not live long enough
5252
--> $DIR/ref-mut-self-async.rs:35:9
@@ -56,7 +56,7 @@ LL | async fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
5656
| |
5757
| let's call the lifetime of this reference `'2`
5858
LL | f
59-
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
59+
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
6060

6161
error: aborting due to 6 previous errors
6262

0 commit comments

Comments
 (0)