Auto merge of #140695 - Zalathar:rollup-i32gzbo, r=Zalathar

Rollup of 12 pull requests

Successful merges:

 - #139550 (Fix `-Zremap-path-scope` rmeta handling)
 - #139764 (Consistent trait bounds for ExtractIf Debug impls)
 - #139773 (Implement `Iterator::last` for `vec::IntoIter`)
 - #140035 (Implement RFC 3503: frontmatters)
 - #140251 (coverage-dump: Resolve global file IDs to filenames)
 - #140393 (std: get rid of `sys_common::process`)
 - #140532 (Fix RustAnalyzer discovery of rustc's `stable_mir` crate)
 - #140598 (Steer docs to `utf8_chunks` and `Iterator::take`)
 - #140634 (Use more accurate ELF flags on MIPS)
 - #140673 (Clean rustdoc tests folder)
 - #140678 (Be a bit more relaxed about not yet constrained infer vars in closure upvar analysis)
 - #140687 (Update mdbook to 0.4.49)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2025-05-06 06:37:30 +00:00
commit 65576ebbd7
5 changed files with 18 additions and 1 deletions

View File

@ -179,6 +179,15 @@ impl<'a> Converter<'a> {
COMMENT
}
rustc_lexer::TokenKind::Frontmatter { has_invalid_preceding_whitespace, invalid_infostring } => {
if *has_invalid_preceding_whitespace {
err = "invalid preceding whitespace for frontmatter opening"
} else if *invalid_infostring {
err = "invalid infostring for frontmatter"
}
FRONTMATTER
}
rustc_lexer::TokenKind::Whitespace => WHITESPACE,
rustc_lexer::TokenKind::Ident if token_text == "_" => UNDERSCORE,

File diff suppressed because one or more lines are too long

View File

@ -133,6 +133,7 @@ Meta =
SourceFile =
'#shebang'?
'#frontmatter'?
Attr*
Item*

View File

@ -1524,6 +1524,10 @@ impl ast::HasAttrs for SourceFile {}
impl ast::HasDocComments for SourceFile {}
impl ast::HasModuleItem for SourceFile {}
impl SourceFile {
#[inline]
pub fn frontmatter_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![frontmatter])
}
#[inline]
pub fn shebang_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![shebang]) }
}

View File

@ -670,6 +670,7 @@ fn generate_syntax_kinds(grammar: KindsSrc) -> String {
[ident] => { $crate::SyntaxKind::IDENT };
[string] => { $crate::SyntaxKind::STRING };
[shebang] => { $crate::SyntaxKind::SHEBANG };
[frontmatter] => { $crate::SyntaxKind::FRONTMATTER };
}
impl ::core::marker::Copy for SyntaxKind {}