Skip to content

Commit 73fdc81

Browse files
committed
Use expr's span
1 parent dff1bc1 commit 73fdc81

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/librustc_typeck/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3358,7 +3358,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
33583358
Applicability::MaybeIncorrect
33593359
};
33603360
err.span_suggestion_with_applicability(
3361-
field.span, help, suggestion, applicability
3361+
expr.span, help, suggestion, applicability
33623362
);
33633363
}
33643364
}

src/test/ui/issues/issue-53712.stderr

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ error[E0609]: no field `0` on type `[{integer}; 5]`
22
--> $DIR/issue-53712.rs:5:9
33
|
44
LL | arr.0;
5-
| ^ help: instead of using tuple indexing, use array indexing: `arr[0]`
5+
| ----^
6+
| |
7+
| help: instead of using tuple indexing, use array indexing: `arr[0]`
68

79
error: aborting due to previous error
810

0 commit comments

Comments
 (0)