about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-02 16:19:45 +0000
committerbors <bors@rust-lang.org>2025-09-02 16:19:45 +0000
commit94722cabf4983abcbe5088c1b8e81517ba2a7126 (patch)
tree41b40635323a5f9330ed3b6b490c4546049b4a38 /compiler/rustc_parse/src
parenta2c8b0b92c14b02f0b3f96a0d5296f1090dc286b (diff)
parent16b9a68eef551b4762bdd283a8b82bc7bb14c4b1 (diff)
downloadrust-94722cabf4983abcbe5088c1b8e81517ba2a7126.tar.gz
rust-94722cabf4983abcbe5088c1b8e81517ba2a7126.zip
Auto merge of #146125 - GuillaumeGomez:rollup-ld81n7e, r=GuillaumeGomez
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#144066 (stabilize c-style varargs for sysv64, win64, efiapi, aapcs)
 - rust-lang/rust#145783 (add span to struct pattern rest (..))
 - rust-lang/rust#146034 (Update target spec metadata of Arm64EC Windows and Trusty targets)
 - rust-lang/rust#146064 (Add compiler error when trying to use concat metavar expr in repetitions)
 - rust-lang/rust#146070 (rustdoc-search: skip loading unneeded fnData)
 - rust-lang/rust#146088 (constify impl Try for ControlFlow)
 - rust-lang/rust#146089 (fix a constness ordering bug in rustfmt)
 - rust-lang/rust#146091 (fix rustdoc `render_call_locations`  panicking because of default span `DUMMY_SP` pointing at non local-source file)
 - rust-lang/rust#146094 (Make `Parser::parse_for_head` public for rustfmt usage)
 - rust-lang/rust#146102 (Remove dead code stemming from an old effects desugaring)
 - rust-lang/rust#146115 (Add maintainer for VxWorks)
 - rust-lang/rust#146116 (Adjust issue-118306.rs test after LLVM change)
 - rust-lang/rust#146117 (Fix search index generation)
 - rust-lang/rust#146118 (improve process::abort rendering in Miri backtraces)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs3
-rw-r--r--compiler/rustc_parse/src/parser/pat.rs2
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 7de4f6efd0b..9b09cbba7af 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -2910,7 +2910,8 @@ impl<'a> Parser<'a> {
         }
     }
 
-    fn parse_for_head(&mut self) -> PResult<'a, (Box<Pat>, Box<Expr>)> {
+    // Public to use it for custom `for` expressions in rustfmt forks like https://github.com/tucant/rustfmt
+    pub fn parse_for_head(&mut self) -> PResult<'a, (Box<Pat>, Box<Expr>)> {
         let begin_paren = if self.token == token::OpenParen {
             // Record whether we are about to parse `for (`.
             // This is used below for recovery in case of `for ( $stuff ) $block`
diff --git a/compiler/rustc_parse/src/parser/pat.rs b/compiler/rustc_parse/src/parser/pat.rs
index 9754691a0b9..c4d30b3d328 100644
--- a/compiler/rustc_parse/src/parser/pat.rs
+++ b/compiler/rustc_parse/src/parser/pat.rs
@@ -1516,7 +1516,7 @@ impl<'a> Parser<'a> {
                 || self.check_noexpect(&token::DotDotDot)
                 || self.check_keyword(exp!(Underscore))
             {
-                etc = PatFieldsRest::Rest;
+                etc = PatFieldsRest::Rest(self.token.span);
                 let mut etc_sp = self.token.span;
                 if first_etc_and_maybe_comma_span.is_none() {
                     if let Some(comma_tok) =