Skip to content

Conversation

@dtolnay
Copy link
Owner

@dtolnay dtolnay commented Mar 24, 2024

syn::custom_keyword! produces potentially unused code if syn's "printing" feature is off, so that a ToTokens impl is not being generated.

This warning is new in nightly-2024-03-24 from rust-lang/rust#119552.

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)

    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)
@dtolnay dtolnay merged commit c218a35 into master Mar 24, 2024
@dtolnay dtolnay deleted the deadcode branch March 24, 2024 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants