Skip to content

Commit

Permalink
Rollup merge of #134366 - harrisonkaiser:no-break-space, r=davidtwco
Browse files Browse the repository at this point in the history
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/rust#132918.
  • Loading branch information
DianQK authored Dec 20, 2024
2 parents 593bfc6 + 32b8aa9 commit 599c3a4
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 599c3a4

Please sign in to comment.