From 2ddfdc666678db6187b44beeb73d67c21484ab37 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 23 Mar 2024 20:14:54 -0700 Subject: [PATCH] Suppress dead code lint on custom token's span field warning: field `span` is never read --> src/custom_keyword.rs:94:17 | 94 | pub span: $crate::__private::Span, | ^^^^ | ::: src/expr.rs:1079:32 | 1079 | crate::custom_keyword!(builtin); | ------------------------------- | | | | | field in this struct | in this macro invocation | = note: `#[warn(dead_code)]` on by default = note: this warning originates in the macro `crate::custom_keyword` (in Nightly builds, run with -Z macro-backtrace for more info) warning: field `span` is never read --> src/custom_keyword.rs:94:17 | 94 | pub span: $crate::__private::Span, | ^^^^ | ::: src/expr.rs:1080:32 | 1080 | crate::custom_keyword!(raw); | --------------------------- | | | | | field in this struct | in this macro invocation | = note: this warning originates in the macro `crate::custom_keyword` (in Nightly builds, run with -Z macro-backtrace for more info) --- src/custom_keyword.rs | 1 + src/custom_punctuation.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/custom_keyword.rs b/src/custom_keyword.rs index 6ce23db41e..cc4f632c98 100644 --- a/src/custom_keyword.rs +++ b/src/custom_keyword.rs @@ -91,6 +91,7 @@ macro_rules! custom_keyword { ($ident:ident) => { #[allow(non_camel_case_types)] pub struct $ident { + #[allow(dead_code)] pub span: $crate::__private::Span, } diff --git a/src/custom_punctuation.rs b/src/custom_punctuation.rs index 1b2c768f44..8923f124a8 100644 --- a/src/custom_punctuation.rs +++ b/src/custom_punctuation.rs @@ -78,6 +78,7 @@ macro_rules! custom_punctuation { ($ident:ident, $($tt:tt)+) => { pub struct $ident { + #[allow(dead_code)] pub spans: $crate::custom_punctuation_repr!($($tt)+), }