From 191b0806d2decdb28e610c4ee8b42cb850798246 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Mon, 27 Jul 2020 18:02:29 -0400 Subject: [PATCH] Capture tokens for Pat used in macro_rules! argument This extends PR #73293 to handle patterns (Pat). Unlike expressions, patterns do not support custom attributes, so we only need to capture tokens during macro_rules! argument parsing. --- clippy_lints/src/unnested_or_patterns.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/clippy_lints/src/unnested_or_patterns.rs b/clippy_lints/src/unnested_or_patterns.rs index b7e2eba0a8178..9fe771cef45bf 100644 --- a/clippy_lints/src/unnested_or_patterns.rs +++ b/clippy_lints/src/unnested_or_patterns.rs @@ -340,6 +340,7 @@ fn take_pat(from: &mut Pat) -> Pat { id: DUMMY_NODE_ID, kind: Wild, span: DUMMY_SP, + tokens: None }; mem::replace(from, dummy) }