about summary refs log tree commit diff
path: root/compiler/rustc_resolve
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-09-02 17:08:52 +0200
committerGitHub <noreply@github.com>2025-09-02 17:08:52 +0200
commitaf315b0725a00e52b74fddfd709b1bb7be7bebbd (patch)
tree9af951545407c52b6ecfa012a64de587dc236bf2 /compiler/rustc_resolve
parentae0e7b97e0c3fa13def0bc60e70d1907c501662e (diff)
parent75d8687f2b6ac1e73071450cb57c4157fcba53b4 (diff)
downloadrust-af315b0725a00e52b74fddfd709b1bb7be7bebbd.tar.gz
rust-af315b0725a00e52b74fddfd709b1bb7be7bebbd.zip
Rollup merge of #145783 - Erk-:et-cetera-span, r=compiler-errors
add span to struct pattern rest (..)

Struct pattern rest (`..`) did not retain span information compared to normal fields. This patch adds span information for it.

The motivation of this patch comes from when I implemented this PR for Clippy: https://github.com/rust-lang/rust-clippy/pull/15000#discussion_r2134145163

It is possible to get the span of the Et cetera in a bit roundabout way, but I thought this would be nicer.
Diffstat (limited to 'compiler/rustc_resolve')
-rw-r--r--compiler/rustc_resolve/src/late.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index d4f7fb276a9..6a12fafcb1e 100644
--- a/compiler/rustc_resolve/src/late.rs
+++ b/compiler/rustc_resolve/src/late.rs
@@ -3922,7 +3922,7 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
 
     fn record_patterns_with_skipped_bindings(&mut self, pat: &Pat, rest: &ast::PatFieldsRest) {
         match rest {
-            ast::PatFieldsRest::Rest | ast::PatFieldsRest::Recovered(_) => {
+            ast::PatFieldsRest::Rest(_) | ast::PatFieldsRest::Recovered(_) => {
                 // Record that the pattern doesn't introduce all the bindings it could.
                 if let Some(partial_res) = self.r.partial_res_map.get(&pat.id)
                     && let Some(res) = partial_res.full_res()