Fix #103451, find_width_of_character_at_span return width with 1 when reaching end
This commit is contained in:
parent
9be2f35a4c
commit
6d455296fd
4 changed files with 46 additions and 10 deletions
5
src/test/ui/parser/issue-103451.rs
Normal file
5
src/test/ui/parser/issue-103451.rs
Normal 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
|
||||
32
src/test/ui/parser/issue-103451.stderr
Normal file
32
src/test/ui/parser/issue-103451.stderr
Normal 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`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue