Skip to content

Commit

Permalink
Ignore more repr_transparent_external_private_fields
Browse files Browse the repository at this point in the history
    warning: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
       --> src/token.rs:378:17
        |
    378 |                   pub spans: [Span; $len],
        |                   ^^^^^^^^^^^^^^^^^^^^^^^
    ...
    560 | / define_punctuation_structs! {
    561 | |     "_" pub struct Underscore/1 /// wildcard patterns, inferred types, unnamed items in constants, extern c...
    562 | | }
        | |_- in this macro invocation
        |
        = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
        = note: for more information, see issue #78586 <rust-lang/rust#78586>
        = note: this struct contains `proc_macro2::Span`, which contains private fields, and makes it not a breaking change to become non-zero-sized in the future.
        = note: `#[warn(repr_transparent_external_private_fields)]` on by default
        = note: this warning originates in the macro `define_punctuation_structs` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
       --> src/token.rs:378:17
        |
    378 |                   pub spans: [Span; $len],
        |                   ^^^^^^^^^^^^^^^^^^^^^^^
    ...
    785 | / define_punctuation! {
    786 | |     "&"           pub struct And/1        /// bitwise and logical AND, borrow, references, reference patterns
    787 | |     "&&"          pub struct AndAnd/2     /// lazy AND, borrow, references, reference patterns
    788 | |     "&="          pub struct AndEq/2      /// bitwise AND assignment
    ...   |
    831 | |     "~"           pub struct Tilde/1      /// unused since before Rust 1.0
    832 | | }
        | |_- in this macro invocation
        |
        = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
        = note: for more information, see issue #78586 <rust-lang/rust#78586>
        = note: this struct contains `proc_macro2::Span`, which contains private fields, and makes it not a breaking change to become non-zero-sized in the future.
        = note: this warning originates in the macro `define_punctuation_structs` which comes from the expansion of the macro `define_punctuation` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
       --> src/token.rs:147:9
        |
    147 |         pub span: Span,
        |         ^^^^^^^^^^^^^^
        |
        = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
        = note: for more information, see issue #78586 <rust-lang/rust#78586>
        = note: this struct contains `proc_macro2::Span`, which contains private fields, and makes it not a breaking change to become non-zero-sized in the future.
  • Loading branch information
dtolnay committed Sep 18, 2023
1 parent 299c782 commit 75cf912
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
#![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

0 comments on commit 75cf912

Please sign in to comment.