Commit 155565f
committed
Fix logical error with what text is considered whitespace.
There is a logical issue around what counts as leading white-space.
There is code which does a subtraction assuming that no errors will be reported
inside the leading whitespace. However we compute the length of
that whitespace with std::char::is_whitespace and not
rustc_lexer::is_whitespace. The former will include a no-break space while
later will excluded it. We can only safely make the assumption that no errors
will be reported in whitespace if it is all "Rust Standard" whitespace.
Indeed an error does occur in unicode whitespace if it contains a no-break
space.1 parent f2b91cc commit 155565f
3 files changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3703 | 3703 | | |
3704 | 3704 | | |
3705 | 3705 | | |
| 3706 | + | |
3706 | 3707 | | |
3707 | 3708 | | |
3708 | 3709 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
1698 | 1699 | | |
1699 | 1700 | | |
1700 | 1701 | | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
1701 | 1707 | | |
1702 | 1708 | | |
1703 | | - | |
| 1709 | + | |
1704 | 1710 | | |
1705 | 1711 | | |
1706 | 1712 | | |
| |||
1709 | 1715 | | |
1710 | 1716 | | |
1711 | 1717 | | |
1712 | | - | |
| 1718 | + | |
1713 | 1719 | | |
1714 | 1720 | | |
1715 | 1721 | | |
| |||
0 commit comments