Skip to content

Commit

Permalink
Work around unknown_lints warning on rustc older than 1.64
Browse files Browse the repository at this point in the history
    warning: unknown lint: `repr_transparent_external_private_fields`
       --> src/lib.rs:255:10
        |
    255 | #![allow(repr_transparent_external_private_fields)]
        |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: `#[warn(unknown_lints)]` on by default
  • Loading branch information
dtolnay committed Sep 18, 2023
1 parent 75cf912 commit fbe3bc2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@
#![doc(html_root_url = "https://docs.rs/syn/2.0.36")]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
#![allow(non_camel_case_types)]
#![allow(repr_transparent_external_private_fields)] // False positive: https://github.com/rust-lang/rust/issues/78586#issuecomment-1722680482
#![allow(
clippy::bool_to_int_with_if,
clippy::cast_lossless,
Expand Down
2 changes: 2 additions & 0 deletions src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ mod private {
/// Support writing `token.span` rather than `token.spans[0]` on tokens that
/// hold a single span.
#[repr(transparent)]
#[allow(unknown_lints, repr_transparent_external_private_fields)] // False positive: https://github.com/rust-lang/rust/issues/78586#issuecomment-1722680482
pub struct WithSpan {
pub span: Span,
}
Expand Down Expand Up @@ -365,6 +366,7 @@ macro_rules! define_punctuation_structs {
($($token:literal pub struct $name:ident/$len:tt #[doc = $usage:literal])*) => {
$(
#[cfg_attr(not(doc), repr(transparent))]
#[allow(unknown_lints, repr_transparent_external_private_fields)] // False positive: https://github.com/rust-lang/rust/issues/78586#issuecomment-1722680482
#[doc = concat!('`', $token, '`')]
///
/// Usage:
Expand Down

0 comments on commit fbe3bc2

Please sign in to comment.