Skip to content

Commit 51596bf

Browse files
committed
Generated new .stderr files
1 parent cf551db commit 51596bf

File tree

6 files changed

+35
-23
lines changed

6 files changed

+35
-23
lines changed

compiler/rustc_hir_typeck/src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3293,7 +3293,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
32933293

32943294
err.span_suggestion_verbose(
32953295
full_span,
3296-
"`->` is not valid in Rust; use `.` on a dereferenced raw pointer instead",
3296+
"use `.` on a dereferenced raw pointer instead",
32973297
replacement,
32983298
Applicability::MachineApplicable,
32993299
);

tests/ui/issues/issue-11004.stderr

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,29 @@ error[E0609]: no field `x` on type `*mut A`
22
--> $DIR/issue-11004.rs:7:21
33
|
44
LL | let x : i32 = n.x;
5-
| ^ unknown field
5+
| --^
6+
| |
7+
| unknown field access via raw pointer
68
|
7-
help: `n` is a raw pointer; try dereferencing it
9+
help: use `.` on a dereferenced raw pointer instead
10+
|
11+
LL - let x : i32 = n.x;
12+
LL + let x : i32 = (*n).x;
813
|
9-
LL | let x : i32 = (*n).x;
10-
| ++ +
1114

1215
error[E0609]: no field `y` on type `*mut A`
1316
--> $DIR/issue-11004.rs:8:21
1417
|
1518
LL | let y : f64 = n.y;
16-
| ^ unknown field
19+
| --^
20+
| |
21+
| unknown field access via raw pointer
22+
|
23+
help: use `.` on a dereferenced raw pointer instead
1724
|
18-
help: `n` is a raw pointer; try dereferencing it
25+
LL - let y : f64 = n.y;
26+
LL + let y : f64 = (*n).y;
1927
|
20-
LL | let y : f64 = (*n).y;
21-
| ++ +
2228

2329
error: aborting due to 2 previous errors
2430

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: `->` used for field access or method call
44
LL | named->foo;
55
| ^^
66
|
7-
= help: the `.` operator will dereference the value if needed
7+
= help: the `.` operator will dereference the value if needed (if value is raw pointer you have to derefernce it by yourself)
88
help: try using `.` instead
99
|
1010
LL - named->foo;
@@ -17,7 +17,7 @@ error: `->` used for field access or method call
1717
LL | unnamed->0;
1818
| ^^
1919
|
20-
= help: the `.` operator will dereference the value if needed
20+
= help: the `.` operator will dereference the value if needed (if value is raw pointer you have to derefernce it by yourself)
2121
help: try using `.` instead
2222
|
2323
LL - unnamed->0;
@@ -30,7 +30,7 @@ error: `->` used for field access or method call
3030
LL | t->0;
3131
| ^^
3232
|
33-
= help: the `.` operator will dereference the value if needed
33+
= help: the `.` operator will dereference the value if needed (if value is raw pointer you have to derefernce it by yourself)
3434
help: try using `.` instead
3535
|
3636
LL - t->0;
@@ -43,7 +43,7 @@ error: `->` used for field access or method call
4343
LL | t->1;
4444
| ^^
4545
|
46-
= help: the `.` operator will dereference the value if needed
46+
= help: the `.` operator will dereference the value if needed (if value is raw pointer you have to derefernce it by yourself)
4747
help: try using `.` instead
4848
|
4949
LL - t->1;
@@ -56,7 +56,7 @@ error: `->` used for field access or method call
5656
LL | foo->clone();
5757
| ^^
5858
|
59-
= help: the `.` operator will dereference the value if needed
59+
= help: the `.` operator will dereference the value if needed (if value is raw pointer you have to derefernce it by yourself)
6060
help: try using `.` instead
6161
|
6262
LL - foo->clone();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ error: `->` used for field access or method call
3939
LL | attr::fn bar() -> String {
4040
| ^^
4141
|
42-
= help: the `.` operator will dereference the value if needed
42+
= help: the `.` operator will dereference the value if needed (if value is raw pointer you have to derefernce it by yourself)
4343
help: try using `.` instead
4444
|
4545
LL - attr::fn bar() -> String {

tests/ui/suggestions/parenthesized-deref-suggestion.stderr

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ error[E0609]: no field `opts` on type `*const Session`
22
--> $DIR/parenthesized-deref-suggestion.rs:7:30
33
|
44
LL | (sess as *const Session).opts;
5-
| ^^^^ unknown field
5+
| -------------------------^^^^
6+
| |
7+
| unknown field access via raw pointer
68
|
7-
help: the value is a raw pointer; try dereferencing it
9+
help: use `.` on a dereferenced raw pointer instead
10+
|
11+
LL - (sess as *const Session).opts;
12+
LL + (*(sess as *const Session)).opts;
813
|
9-
LL | (*(sess as *const Session)).opts;
10-
| ++ +
1114

1215
error[E0609]: no field `0` on type `[u32; 1]`
1316
--> $DIR/parenthesized-deref-suggestion.rs:10:21

tests/ui/unsafe/unsafe-fn-autoderef.stderr

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ error[E0609]: no field `f` on type `*const Rec`
22
--> $DIR/unsafe-fn-autoderef.rs:19:14
33
|
44
LL | return p.f;
5-
| ^ unknown field
5+
| --^
6+
| |
7+
| unknown field access via raw pointer
68
|
7-
help: `p` is a raw pointer; try dereferencing it
9+
help: use `.` on a dereferenced raw pointer instead
10+
|
11+
LL - return p.f;
12+
LL + return (*p).f;
813
|
9-
LL | return (*p).f;
10-
| ++ +
1114

1215
error: aborting due to 1 previous error
1316

0 commit comments

Comments
 (0)