This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 3d93866
authored
Unrolled build for rust-lang#134366
Rollup merge of rust-lang#134366 - harrisonkaiser:no-break-space, r=davidtwco
Fix logical error with what text is considered whitespace.
There appears to be 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. In that case the subtraction will cause a ICE (for a compiler in debug mode) as described in rust-lang#132918.File tree
5 files changed
+34
-2
lines changed- compiler/rustc_errors
- src
- tests/ui/errors
5 files changed
+34
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3722 | 3722 | | |
3723 | 3723 | | |
3724 | 3724 | | |
| 3725 | + | |
3725 | 3726 | | |
3726 | 3727 | | |
3727 | 3728 | | |
| |||
| 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 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments