diff options
| author | Michael Howell <michael@notriddle.com> | 2023-02-21 14:11:08 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2023-02-22 08:40:47 -0700 |
| commit | 3f374128ee3924514aacadf96479e17fee8f9903 (patch) | |
| tree | 2b0e58a547768a464864cec072eac77be620c1c4 /tests/ui/async-await | |
| parent | 3d056c31257cc26760b7e65c5dfdae069f7ddc74 (diff) | |
| download | rust-3f374128ee3924514aacadf96479e17fee8f9903.tar.gz rust-3f374128ee3924514aacadf96479e17fee8f9903.zip | |
diagnostics: update test cases to refer to assoc fn with `self` as method
Diffstat (limited to 'tests/ui/async-await')
| -rw-r--r-- | tests/ui/async-await/issues/issue-62097.rs | 2 | ||||
| -rw-r--r-- | tests/ui/async-await/issues/issue-62097.stderr | 6 | ||||
| -rw-r--r-- | tests/ui/async-await/issues/issue-72312.stderr | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/tests/ui/async-await/issues/issue-62097.rs b/tests/ui/async-await/issues/issue-62097.rs index a24c84cffc7..13c72abb136 100644 --- a/tests/ui/async-await/issues/issue-62097.rs +++ b/tests/ui/async-await/issues/issue-62097.rs @@ -12,7 +12,7 @@ impl Struct { pub async fn run_dummy_fn(&self) { foo(|| self.bar()).await; //~^ ERROR closure may outlive the current function - //~| ERROR borrowed data escapes outside of associated function + //~| ERROR borrowed data escapes outside of method } pub fn bar(&self) {} diff --git a/tests/ui/async-await/issues/issue-62097.stderr b/tests/ui/async-await/issues/issue-62097.stderr index 786f6213260..21a61548d01 100644 --- a/tests/ui/async-await/issues/issue-62097.stderr +++ b/tests/ui/async-await/issues/issue-62097.stderr @@ -16,18 +16,18 @@ 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 associated 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 associated function body + | `self` is a reference that is only valid in the method body | let's call the lifetime of this reference `'1` LL | foo(|| self.bar()).await; | ^^^^^^^^^^^^^^^^^^ | | - | `self` escapes the associated function body here + | `self` escapes the method body here | argument requires that `'1` must outlive `'static` error: aborting due to 2 previous errors diff --git a/tests/ui/async-await/issues/issue-72312.stderr b/tests/ui/async-await/issues/issue-72312.stderr index aa947b69003..679272858bd 100644 --- a/tests/ui/async-await/issues/issue-72312.stderr +++ b/tests/ui/async-await/issues/issue-72312.stderr @@ -1,10 +1,10 @@ -error[E0521]: borrowed data escapes outside of associated function +error[E0521]: borrowed data escapes outside of method --> $DIR/issue-72312.rs:12:9 | LL | pub async fn start(&self) { | ----- | | - | `self` is a reference that is only valid in the associated function body + | `self` is a reference that is only valid in the method body | let's call the lifetime of this reference `'1` ... LL | / require_static(async move { @@ -15,7 +15,7 @@ LL | | &self; LL | | }); | | ^ | | | - | |__________`self` escapes the associated function body here + | |__________`self` escapes the method body here | argument requires that `'1` must outlive `'static` error: aborting due to previous error |
