Skip to content

Commit 0e6e75d

Browse files
committed
fixed stderr files
1 parent b372c23 commit 0e6e75d

9 files changed

+24
-83
lines changed

compiler/rustc_parse/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ parse_expected_struct_field = expected one of `,`, `:`, or `{"}"}`, found `{$tok
246246
247247
parse_expected_trait_in_trait_impl_found_type = expected a trait, found type
248248
249-
parse_expr_rarrow_call = `->` used for field access or method call
249+
parse_expr_rarrow_call = `->` is not valid for field access or method call
250250
.suggestion = try using `.` instead
251251
.help = the `.` operator will automatically dereference the value, except if the value is a raw pointer
252252

tests/ui/parser/expr-rarrow-call-on-a-raw-pointer.fixed

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ struct Named {
1111
struct Unnamed(usize);
1212

1313
unsafe fn named_struct_field_access(named: *mut Named) {
14-
(*named).foo += 1; //~ ERROR `->` used for field access or method call
14+
(*named).foo += 1; //~ ERROR `->` is not valid for field access or method call
1515
//~^ ERROR no field `foo` on type `*mut Named`
1616
}
1717

1818
unsafe fn unnamed_struct_field_access(unnamed: *mut Unnamed) {
19-
(*unnamed).0 += 1; //~ ERROR `->` used for field access or method call
19+
(*unnamed).0 += 1; //~ ERROR `->` is not valid for field access or method call
2020
//~^ ERROR no field `0` on type `*mut Unnamed`
2121
}
2222

tests/ui/parser/expr-rarrow-call-on-a-raw-pointer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ struct Named {
1111
struct Unnamed(usize);
1212

1313
unsafe fn named_struct_field_access(named: *mut Named) {
14-
named->foo += 1; //~ ERROR `->` used for field access or method call
14+
named->foo += 1; //~ ERROR `->` is not valid for field access or method call
1515
//~^ ERROR no field `foo` on type `*mut Named`
1616
}
1717

1818
unsafe fn unnamed_struct_field_access(unnamed: *mut Unnamed) {
19-
unnamed->0 += 1; //~ ERROR `->` used for field access or method call
19+
unnamed->0 += 1; //~ ERROR `->` is not valid for field access or method call
2020
//~^ ERROR no field `0` on type `*mut Unnamed`
2121
}
2222

tests/ui/parser/expr-rarrow-call-on-a-raw-pointer.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
error: `->` used for field access or method call
1+
error: `->` is not valid for field access or method call
22
--> $DIR/expr-rarrow-call-on-a-raw-pointer.rs:14:10
33
|
44
LL | named->foo += 1;
55
| ^^
66
|
77
= help: the `.` operator will automatically dereference the value, except if the value is a raw pointer
88

9-
error: `->` used for field access or method call
9+
error: `->` is not valid for field access or method call
1010
--> $DIR/expr-rarrow-call-on-a-raw-pointer.rs:19:12
1111
|
1212
LL | unnamed->0 += 1;

tests/ui/parser/expr-rarrow-call.fixed

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@ run-rustfix
21
#![allow(
32
dead_code,
43
unused_must_use
@@ -11,23 +10,23 @@ struct Named {
1110
struct Unnamed(usize);
1211

1312
fn named_struct_field_access(named: &Named) {
14-
named->foo; //~ ERROR `->` used for field access or method call
13+
named->foo; //~ ERROR `->` is not valid for field access or method call
1514
}
1615

1716
fn unnamed_struct_field_access(unnamed: &Unnamed) {
18-
unnamed->0; //~ ERROR `->` used for field access or method call
17+
unnamed->0; //~ ERROR `->` is not valid for field access or method call
1918
}
2019

2120
fn tuple_field_access(t: &(u8, u8)) {
22-
t->0; //~ ERROR `->` used for field access or method call
23-
t->1; //~ ERROR `->` used for field access or method call
21+
t->0; //~ ERROR `->` is not valid for field access or method call
22+
t->1; //~ ERROR `->` is not valid for field access or method call
2423
}
2524

2625
#[derive(Clone)]
2726
struct Foo;
2827

2928
fn method_call(foo: &Foo) {
30-
foo->clone(); //~ ERROR `->` used for field access or method call
29+
foo->clone(); //~ ERROR `->` is not valid for field access or method call
3130
}
3231

3332
fn main() {}
Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,42 @@
1-
error: `->` used for field access or method call
2-
--> $DIR/expr-rarrow-call.rs:14:10
1+
error: `->` is not valid for field access or method call
2+
--> $DIR/expr-rarrow-call.rs:13:10
33
|
44
LL | named->foo;
55
| ^^
66
|
77
= help: the `.` operator will automatically dereference the value, except if the value is a raw pointer
8-
help: try using `.` instead
9-
|
10-
LL - named->foo;
11-
LL + named.foo;
12-
|
138

14-
error: `->` used for field access or method call
15-
--> $DIR/expr-rarrow-call.rs:18:12
9+
error: `->` is not valid for field access or method call
10+
--> $DIR/expr-rarrow-call.rs:17:12
1611
|
1712
LL | unnamed->0;
1813
| ^^
1914
|
2015
= help: the `.` operator will automatically dereference the value, except if the value is a raw pointer
21-
help: try using `.` instead
22-
|
23-
LL - unnamed->0;
24-
LL + unnamed.0;
25-
|
2616

27-
error: `->` used for field access or method call
28-
--> $DIR/expr-rarrow-call.rs:22:6
17+
error: `->` is not valid for field access or method call
18+
--> $DIR/expr-rarrow-call.rs:21:6
2919
|
3020
LL | t->0;
3121
| ^^
3222
|
3323
= help: the `.` operator will automatically dereference the value, except if the value is a raw pointer
34-
help: try using `.` instead
35-
|
36-
LL - t->0;
37-
LL + t.0;
38-
|
3924

40-
error: `->` used for field access or method call
41-
--> $DIR/expr-rarrow-call.rs:23:6
25+
error: `->` is not valid for field access or method call
26+
--> $DIR/expr-rarrow-call.rs:22:6
4227
|
4328
LL | t->1;
4429
| ^^
4530
|
4631
= help: the `.` operator will automatically dereference the value, except if the value is a raw pointer
47-
help: try using `.` instead
48-
|
49-
LL - t->1;
50-
LL + t.1;
51-
|
5232

53-
error: `->` used for field access or method call
54-
--> $DIR/expr-rarrow-call.rs:30:8
33+
error: `->` is not valid for field access or method call
34+
--> $DIR/expr-rarrow-call.rs:29:8
5535
|
5636
LL | foo->clone();
5737
| ^^
5838
|
5939
= help: the `.` operator will automatically dereference the value, except if the value is a raw pointer
60-
help: try using `.` instead
61-
|
62-
LL - foo->clone();
63-
LL + foo.clone();
64-
|
6540

6641
error: aborting due to 5 previous errors
6742

tests/ui/parser/issues/issue-118530-ice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ fn bar() -> String {
55
attr::fn bar() -> String { //~ ERROR expected identifier, found keyword `fn`
66
//~^ ERROR expected one of `(`, `.`, `::`, `;`, `?`, `}`, or an operator, found `{`
77
//~| ERROR expected `;`, found `bar`
8-
//~| ERROR `->` used for field access or method call
8+
//~| ERROR `->` is not valid for field access or method call
99
#[attr]
1010
[1, 2, 3].iter().map().collect::<String>()
1111
#[attr]

tests/ui/parser/issues/issue-118530-ice.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ LL | attr::fn bar() -> String {
3333
| |
3434
| help: add `;` here
3535

36-
error: `->` used for field access or method call
36+
error: `->` is not valid for field access or method call
3737
--> $DIR/issue-118530-ice.rs:5:20
3838
|
3939
LL | attr::fn bar() -> String {

0 commit comments

Comments
 (0)