From 75cf912e061ef5a1d97c003f4988f43d7639f5a8 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 17 Sep 2023 19:47:05 -0700 Subject: [PATCH] Ignore more repr_transparent_external_private_fields 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 = 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 = 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 = 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. --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index 2866421707..1d91c5ac6b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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,