Fix #103451, find_width_of_character_at_span return width with 1 when reaching end

This commit is contained in:
yukang 2022-10-25 20:47:19 +08:00
parent 9be2f35a4c
commit 6d455296fd
4 changed files with 46 additions and 10 deletions

View file

@ -0,0 +1,5 @@
// error-pattern: this file contains an unclosed delimiter
// error-pattern: expected value, found struct `R`
struct R { }
struct S {
x: [u8; R

View file

@ -0,0 +1,32 @@
error: this file contains an unclosed delimiter
--> $DIR/issue-103451.rs:5:15
|
LL | struct S {
| - unclosed delimiter
LL | x: [u8; R
| - ^
| |
| unclosed delimiter
error: this file contains an unclosed delimiter
--> $DIR/issue-103451.rs:5:15
|
LL | struct S {
| - unclosed delimiter
LL | x: [u8; R
| - ^
| |
| unclosed delimiter
error[E0423]: expected value, found struct `R`
--> $DIR/issue-103451.rs:5:13
|
LL | struct R { }
| ------------ `R` defined here
LL | struct S {
LL | x: [u8; R
| ^ help: use struct literal syntax instead: `R {}`
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0423`.