diff options
| author | bors <bors@rust-lang.org> | 2025-09-03 14:20:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-09-03 14:20:23 +0000 |
| commit | fd75a9c32d643f39c8c61df770d2cff60b3fefd5 (patch) | |
| tree | c37bb00bebb8e080cb67262f51620a3ee816220f /compiler/rustc_parse/src | |
| parent | 51ff895062ba60a7cba53f57af928c3fb7b0f2f4 (diff) | |
| parent | 263048d06327d104e4e49d1288bc392c96c494fe (diff) | |
| download | rust-fd75a9c32d643f39c8c61df770d2cff60b3fefd5.tar.gz rust-fd75a9c32d643f39c8c61df770d2cff60b3fefd5.zip | |
Auto merge of #146160 - Zalathar:rollup-qxphx7g, r=Zalathar
Rollup of 8 pull requests Successful merges: - rust-lang/rust#145279 (Constify conversion traits (part 1)) - rust-lang/rust#145414 (unicode-table-generator refactors) - rust-lang/rust#145823 (editorconfig: don't use nonexistent syntax) - rust-lang/rust#145944 (std: Start supporting WASIp2 natively ) - rust-lang/rust#145961 (resolve: Avoid a regression from splitting prelude into two scopes) - rust-lang/rust#146032 (Explicity disable LSX feature for `loongarch64-unknown-none` target) - rust-lang/rust#146106 (fix(lexer): Only allow horizontal whitespace in frontmatter ) - rust-lang/rust#146154 (CI: rfl: move job forward to Linux v6.17-rc3 plus 2 commits) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/lexer/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/lexer/mod.rs b/compiler/rustc_parse/src/lexer/mod.rs index 9792240a548..e3bd6a9a327 100644 --- a/compiler/rustc_parse/src/lexer/mod.rs +++ b/compiler/rustc_parse/src/lexer/mod.rs @@ -6,7 +6,7 @@ use rustc_ast::util::unicode::{TEXT_FLOW_CONTROL_CHARS, contains_text_flow_contr use rustc_errors::codes::*; use rustc_errors::{Applicability, Diag, DiagCtxtHandle, StashKey}; use rustc_lexer::{ - Base, Cursor, DocStyle, FrontmatterAllowed, LiteralKind, RawStrError, is_whitespace, + Base, Cursor, DocStyle, FrontmatterAllowed, LiteralKind, RawStrError, is_horizontal_whitespace, }; use rustc_literal_escaper::{EscapeError, Mode, check_for_errors}; use rustc_session::lint::BuiltinLintDiag; @@ -597,7 +597,7 @@ impl<'psess, 'src> Lexer<'psess, 'src> { let last_line_start = within.rfind('\n').map_or(0, |i| i + 1); let last_line = &within[last_line_start..]; - let last_line_trimmed = last_line.trim_start_matches(is_whitespace); + let last_line_trimmed = last_line.trim_start_matches(is_horizontal_whitespace); let last_line_start_pos = frontmatter_opening_end_pos + BytePos(last_line_start as u32); let frontmatter_span = self.mk_sp(frontmatter_opening_pos, self.pos); @@ -640,7 +640,7 @@ impl<'psess, 'src> Lexer<'psess, 'src> { }); } - if !rest.trim_matches(is_whitespace).is_empty() { + if !rest.trim_matches(is_horizontal_whitespace).is_empty() { let span = self.mk_sp(last_line_start_pos, self.pos); self.dcx().emit_err(errors::FrontmatterExtraCharactersAfterClose { span }); } |
