Skip to content

Commit

Permalink
update some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-i-m committed Feb 22, 2020
1 parent 7a6361f commit 9434d6b
Show file tree
Hide file tree
Showing 22 changed files with 77 additions and 77 deletions.
6 changes: 3 additions & 3 deletions src/test/ui/async-await/issues/issue-62097.nll.stderr
Expand Up @@ -16,13 +16,13 @@ help: to force the closure to take ownership of `self` (and any other referenced
LL | foo(move || self.bar()).await;
| ^^^^^^^

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

error: aborting due to 2 previous errors

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/async-await/issues/issue-63388-1.nll.stderr
Expand Up @@ -9,7 +9,7 @@ LL | ) -> &dyn Foo
LL | / {
LL | | foo
LL | | }
| |_____^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
| |_____^ method was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`

error: aborting due to previous error

6 changes: 3 additions & 3 deletions src/test/ui/issues/issue-16683.nll.stderr
@@ -1,10 +1,10 @@
error[E0521]: borrowed data escapes outside of function
error[E0521]: borrowed data escapes outside of method
--> $DIR/issue-16683.rs:4:9
|
LL | fn b(&self) {
| ----- `self` is a reference that is only valid in the function body
| ----- `self` is a reference that is only valid in the method body
LL | self.a();
| ^^^^^^^^ `self` escapes the function body here
| ^^^^^^^^ `self` escapes the method body here

error: aborting due to previous error

6 changes: 3 additions & 3 deletions src/test/ui/issues/issue-17758.nll.stderr
@@ -1,10 +1,10 @@
error[E0521]: borrowed data escapes outside of function
error[E0521]: borrowed data escapes outside of method
--> $DIR/issue-17758.rs:7:9
|
LL | fn bar(&self) {
| ----- `self` is a reference that is only valid in the function body
| ----- `self` is a reference that is only valid in the method body
LL | self.foo();
| ^^^^^^^^^^ `self` escapes the function body here
| ^^^^^^^^^^ `self` escapes the method body here

error: aborting due to previous error

Expand Up @@ -7,7 +7,7 @@ LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
| lifetime `'a` defined here
LL |
LL | if x > y { x } else { y }
| ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
| ^ method was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`

error: aborting due to previous error

Expand Up @@ -7,7 +7,7 @@ LL | fn foo<'a>(&self, x: &'a i32) -> &i32 {
| lifetime `'a` defined here
LL |
LL | x
| ^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
| ^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`

error: aborting due to previous error

Expand Up @@ -7,7 +7,7 @@ LL | fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
| lifetime `'a` defined here
LL |
LL | if true { x } else { self }
| ^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
| ^^^^ method was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`

error: aborting due to previous error

Expand Up @@ -6,7 +6,7 @@ LL | fn foo<'a>(&self, x: &i32) -> &i32 {
| |
| let's call the lifetime of this reference `'2`
LL | x
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`

error: aborting due to previous error

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

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/nll/outlives-suggestion-simple.rs
Expand Up @@ -70,7 +70,7 @@ pub struct Foo2<'a> {
impl<'a> Foo2<'a> {
// should not produce outlives suggestions to name 'self
fn get_bar(&self) -> Bar2 {
Bar2::new(&self) //~ERROR borrowed data escapes outside of function
Bar2::new(&self) //~ERROR borrowed data escapes outside of method
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/nll/outlives-suggestion-simple.stderr
Expand Up @@ -93,16 +93,16 @@ LL | self.x
|
= help: consider adding the following bound: `'b: 'a`

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

error: aborting due to 9 previous errors

Expand Up @@ -2,7 +2,7 @@ error: lifetime may not live long enough
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:8:52
|
LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
| - - ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| - - ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| | |
| | let's call the lifetime of this reference `'1`
| let's call the lifetime of this reference `'2`
Expand All @@ -11,7 +11,7 @@ error: lifetime may not live long enough
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:75
|
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
| - - ^^^^^^^^^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| - - ^^^^^^^^^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| | |
| | let's call the lifetime of this reference `'1`
| let's call the lifetime of this reference `'2`
Expand All @@ -20,7 +20,7 @@ error: lifetime may not live long enough
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:17:64
|
LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
| -- - ^^^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
| -- - ^^^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
| | |
| | let's call the lifetime of this reference `'1`
| lifetime `'a` defined here
Expand Down
Expand Up @@ -2,7 +2,7 @@ error: lifetime may not live long enough
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:6:46
|
LL | fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
| - - ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| - - ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| | |
| | let's call the lifetime of this reference `'1`
| let's call the lifetime of this reference `'2`
Expand All @@ -11,7 +11,7 @@ error: lifetime may not live long enough
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:8:69
|
LL | fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
| - - ^^^^^^^^^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| - - ^^^^^^^^^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| | |
| | let's call the lifetime of this reference `'1`
| let's call the lifetime of this reference `'2`
Expand All @@ -20,7 +20,7 @@ error: lifetime may not live long enough
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:13:58
|
LL | fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
| -- ---- has type `std::pin::Pin<&'1 Foo>` ^^^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
| -- ---- has type `std::pin::Pin<&'1 Foo>` ^^^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
| |
| lifetime `'a` defined here

Expand Down
12 changes: 6 additions & 6 deletions src/test/ui/self/elision/lt-ref-self-async.nll.stderr
Expand Up @@ -6,7 +6,7 @@ LL | async fn ref_self(&self, f: &u32) -> &u32 {
| |
| let's call the lifetime of this reference `'2`
LL | f
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`

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

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

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

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

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

error: aborting due to 6 previous errors

12 changes: 6 additions & 6 deletions src/test/ui/self/elision/lt-ref-self.nll.stderr
Expand Up @@ -6,7 +6,7 @@ LL | fn ref_self(&self, f: &u32) -> &u32 {
| |
| let's call the lifetime of this reference `'2`
LL | f
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`

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

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

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

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

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

error: aborting due to 6 previous errors

12 changes: 6 additions & 6 deletions src/test/ui/self/elision/ref-mut-self-async.nll.stderr
Expand Up @@ -6,7 +6,7 @@ LL | async fn ref_self(&mut self, f: &u32) -> &u32 {
| |
| let's call the lifetime of this reference `'2`
LL | f
| ^ function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`

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

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

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

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

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

error: aborting due to 6 previous errors

0 comments on commit 9434d6b

Please sign in to comment.