Skip to content

Commit 3f37412

Browse files
committed
diagnostics: update test cases to refer to assoc fn with self as method
1 parent 3d056c3 commit 3f37412

File tree

133 files changed

+650
-636
lines changed

Some content is hidden

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

133 files changed

+650
-636
lines changed

tests/ui/argument-suggestions/too-long.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | qux.foo(a, b, c, d, e, f, g, h, i, j, k, l);
66
| |
77
| arguments to this method are incorrect
88
|
9-
note: associated function defined here
9+
note: method defined here
1010
--> $DIR/too-long.rs:4:8
1111
|
1212
LL | fn foo(

tests/ui/associated-types/associated-type-projection-from-supertrait.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ LL | fn f() { ModelT.chip_paint(Blue); }
3434
| |
3535
| arguments to this method are incorrect
3636
|
37-
note: associated function defined here
37+
note: method defined here
3838
--> $DIR/associated-type-projection-from-supertrait.rs:12:8
3939
|
4040
LL | fn chip_paint(&self, c: Self::Color) { }
@@ -48,7 +48,7 @@ LL | fn g() { ModelU.chip_paint(Black); }
4848
| |
4949
| arguments to this method are incorrect
5050
|
51-
note: associated function defined here
51+
note: method defined here
5252
--> $DIR/associated-type-projection-from-supertrait.rs:12:8
5353
|
5454
LL | fn chip_paint(&self, c: Self::Color) { }

tests/ui/async-await/issues/issue-62097.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ impl Struct {
1212
pub async fn run_dummy_fn(&self) {
1313
foo(|| self.bar()).await;
1414
//~^ ERROR closure may outlive the current function
15-
//~| ERROR borrowed data escapes outside of associated function
15+
//~| ERROR borrowed data escapes outside of method
1616
}
1717

1818
pub fn bar(&self) {}

tests/ui/async-await/issues/issue-62097.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ 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 associated 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) {
2323
| -----
2424
| |
25-
| `self` is a reference that is only valid in the associated function body
25+
| `self` is a reference that is only valid in the method body
2626
| let's call the lifetime of this reference `'1`
2727
LL | foo(|| self.bar()).await;
2828
| ^^^^^^^^^^^^^^^^^^
2929
| |
30-
| `self` escapes the associated function body here
30+
| `self` escapes the method body here
3131
| argument requires that `'1` must outlive `'static`
3232

3333
error: aborting due to 2 previous errors

tests/ui/async-await/issues/issue-72312.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error[E0521]: borrowed data escapes outside of associated function
1+
error[E0521]: borrowed data escapes outside of method
22
--> $DIR/issue-72312.rs:12:9
33
|
44
LL | pub async fn start(&self) {
55
| -----
66
| |
7-
| `self` is a reference that is only valid in the associated function body
7+
| `self` is a reference that is only valid in the method body
88
| let's call the lifetime of this reference `'1`
99
...
1010
LL | / require_static(async move {
@@ -15,7 +15,7 @@ LL | | &self;
1515
LL | | });
1616
| | ^
1717
| | |
18-
| |__________`self` escapes the associated function body here
18+
| |__________`self` escapes the method body here
1919
| argument requires that `'1` must outlive `'static`
2020

2121
error: aborting due to previous error

tests/ui/borrowck/issue-103624.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ impl StructA {
1212
async fn foo(&self) {
1313
let bar = self.b.bar().await;
1414
spawn_blocking(move || {
15-
//~^ ERROR borrowed data escapes outside of associated function
15+
//~^ ERROR borrowed data escapes outside of method
1616
self.b;
1717
//~^ ERROR cannot move out of `self.b`, as `self` is a captured variable in an `Fn` closure
1818
})

tests/ui/borrowck/issue-103624.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ LL |
1010
LL | self.b;
1111
| ^^^^^^ move occurs because `self.b` has type `StructB`, which does not implement the `Copy` trait
1212

13-
error[E0521]: borrowed data escapes outside of associated function
13+
error[E0521]: borrowed data escapes outside of method
1414
--> $DIR/issue-103624.rs:14:9
1515
|
1616
LL | async fn foo(&self) {
1717
| -----
1818
| |
19-
| `self` is a reference that is only valid in the associated function body
19+
| `self` is a reference that is only valid in the method body
2020
| let's call the lifetime of this reference `'1`
2121
LL | let bar = self.b.bar().await;
2222
LL | / spawn_blocking(move || {
@@ -26,7 +26,7 @@ LL | |
2626
LL | | })
2727
| | ^
2828
| | |
29-
| |__________`self` escapes the associated function body here
29+
| |__________`self` escapes the method body here
3030
| argument requires that `'1` must outlive `'static`
3131

3232
error: aborting due to 2 previous errors

tests/ui/const-generics/generic_const_exprs/issue-105608.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0282]: type annotations needed
22
--> $DIR/issue-105608.rs:13:22
33
|
44
LL | Combination::<0>.and::<_>().and::<_>();
5-
| ^^^ cannot infer type of the type parameter `M` declared on the associated function `and`
5+
| ^^^ cannot infer type of the type parameter `M` declared on the method `and`
66
|
77
help: consider specifying the generic argument
88
|

tests/ui/const-generics/infer/method-chain.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0282]: type annotations needed
22
--> $DIR/method-chain.rs:15:33
33
|
44
LL | Foo.bar().bar().bar().bar().baz();
5-
| ^^^ cannot infer the value of the const parameter `N` declared on the associated function `baz`
5+
| ^^^ cannot infer the value of the const parameter `N` declared on the method `baz`
66
|
77
help: consider specifying the generic argument
88
|

tests/ui/const-generics/infer/uninferred-consts.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0282]: type annotations needed
22
--> $DIR/uninferred-consts.rs:9:9
33
|
44
LL | Foo.foo();
5-
| ^^^ cannot infer the value of the const parameter `A` declared on the associated function `foo`
5+
| ^^^ cannot infer the value of the const parameter `A` declared on the method `foo`
66
|
77
help: consider specifying the generic arguments
88
|

tests/ui/const-generics/invalid-const-arg-for-type-param.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ struct S;
44

55
fn main() {
66
let _: u32 = 5i32.try_into::<32>().unwrap();
7-
//~^ ERROR this associated function takes
7+
//~^ ERROR this method takes
88

99
S.f::<0>();
1010
//~^ ERROR no method named `f`

tests/ui/const-generics/invalid-const-arg-for-type-param.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
1+
error[E0107]: this method takes 0 generic arguments but 1 generic argument was supplied
22
--> $DIR/invalid-const-arg-for-type-param.rs:6:23
33
|
44
LL | let _: u32 = 5i32.try_into::<32>().unwrap();

0 commit comments

Comments
 (0)