Skip to content

Commit

Permalink
Work around new dead_code warning
Browse files Browse the repository at this point in the history
    warning: field `0` is never read
      --> src/marker.rs:15:39
       |
    15 | pub(crate) struct ProcMacroAutoTraits(Rc<()>);
       |                   ------------------- ^^^^^^
       |                   |
       |                   field in this struct
       |
       = note: `#[warn(dead_code)]` on by default
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
       |
    15 | pub(crate) struct ProcMacroAutoTraits(());
       |                                       ~~
  • Loading branch information
dtolnay committed Jan 6, 2024
1 parent 2a9b955 commit 228503f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mod value {
pub(crate) use core::marker::PhantomData as Marker;
}

pub(crate) struct ProcMacroAutoTraits(Rc<()>);
pub(crate) struct ProcMacroAutoTraits(#[allow(dead_code)] Rc<()>);

impl UnwindSafe for ProcMacroAutoTraits {}
impl RefUnwindSafe for ProcMacroAutoTraits {}
2 changes: 1 addition & 1 deletion tests/ui/test-not-send.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ error[E0277]: `Rc<()>` cannot be sent between threads safely
note: required because it appears within the type `proc_macro2::marker::ProcMacroAutoTraits`
--> $WORKSPACE/src/marker.rs
|
| pub(crate) struct ProcMacroAutoTraits(Rc<()>);
| pub(crate) struct ProcMacroAutoTraits(#[allow(dead_code)] Rc<()>);
| ^^^^^^^^^^^^^^^^^^^
note: required because it appears within the type `PhantomData<proc_macro2::marker::ProcMacroAutoTraits>`
--> $RUST/core/src/marker.rs
Expand Down

0 comments on commit 228503f

Please sign in to comment.