Skip to content

Commit aa13a5d

Browse files
authored
Unrolled build for #153385
Rollup merge of #153385 - traviscross:TC/fix-frontmatter-whitespace-comment, r=Kivooeo,epage Fix comment on `is_horizontal_whitespace` The comment on `is_horizontal_whitespace` says "This is Pattern_White_Space", but the function matches only tab (U+0009) and space (U+0020) -- two of the eleven `Pattern_White_Space` code points. This has been the case since #146106, which narrowed the set from full `Pattern_White_Space` to the horizontal subset. The correct characterization is that this is the horizontal space subset of `Pattern_White_Space`, as categorized by UAX 31, Section 4.1, which partitions `Pattern_White_Space` into line endings, ignorable format controls, and horizontal space. r? fee1-dead (reviewer on #146106) cc @ehuss @epage
2 parents f8704be + fe71b66 commit aa13a5d

File tree

1 file changed

+2
-1
lines changed
  • compiler/rustc_lexer/src

1 file changed

+2
-1
lines changed

compiler/rustc_lexer/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ pub fn is_whitespace(c: char) -> bool {
367367

368368
/// True if `c` is considered horizontal whitespace according to Rust language definition.
369369
pub fn is_horizontal_whitespace(c: char) -> bool {
370-
// This is Pattern_White_Space.
370+
// This is the horizontal space subset of `Pattern_White_Space` as
371+
// categorized by UAX #31, Section 4.1.
371372
//
372373
// Note that this set is stable (ie, it doesn't change with different
373374
// Unicode versions), so it's ok to just hard-code the values.

0 commit comments

Comments
 (0)