janitor: Fix warnings about unused members

I get warnings about unused members using the nightly compiler, one for
each member in all structs that derive the `FieldOffsets` macro. That is
a lot.

This fixes that as well as the one occurrence of that same warning in
unrelated code.
This commit is contained in:
Tobias Hunger 2024-01-08 16:20:57 +01:00 committed by Tobias Hunger
parent 5e9d352217
commit 9faffc75bb
2 changed files with 5 additions and 4 deletions

View file

@ -218,6 +218,7 @@ pub fn const_field_offset(input: TokenStream) -> TokenStream {
},
Some(quote! {
/// Make sure that Unpin is not implemented
#[allow(dead_code)]
pub struct __MustNotImplUnpin<'__dummy_lifetime> (
#(#types, )*
::core::marker::PhantomData<&'__dummy_lifetime ()>
@ -245,7 +246,7 @@ pub fn const_field_offset(input: TokenStream) -> TokenStream {
// Build the output, possibly using quasi-quotation
let expanded = quote! {
#[doc = #doc]
#[allow(missing_docs, non_camel_case_types)]
#[allow(missing_docs, non_camel_case_types, dead_code)]
#struct_vis struct #field_struct_name {
#(#vis #fields : #crate_::FieldOffset<#struct_name, #types, #pin_flag>,)*
}