Skip to content

Commit

Permalink
Add link to dead_code autotrait bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 6, 2024
1 parent 228503f commit 436ce07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ mod value {
pub(crate) use core::marker::PhantomData as Marker;
}

pub(crate) struct ProcMacroAutoTraits(#[allow(dead_code)] Rc<()>);
pub(crate) struct ProcMacroAutoTraits(
#[allow(dead_code)] // https://github.com/rust-lang/rust/issues/119645

This comment has been minimized.

Copy link
@compiler-errors

compiler-errors Jan 6, 2024

Should this just be changed to PhantomData<Rc<()>>?

This comment has been minimized.

Copy link
@dtolnay

dtolnay Jan 6, 2024

Author Owner

Yes; however there is already a PhantomData wrapping ProcMacroAutoTraits, so it would become PhantomData containing ProcMacroAutoTraits containing PhantomData. What I can do is transpose the existing PhantomData into ProcMacroAutoTraits like this: #436.

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(#[allow(dead_code)] Rc<()>);
| pub(crate) struct ProcMacroAutoTraits(
| ^^^^^^^^^^^^^^^^^^^
note: required because it appears within the type `PhantomData<proc_macro2::marker::ProcMacroAutoTraits>`
--> $RUST/core/src/marker.rs
Expand Down

0 comments on commit 436ce07

Please sign in to comment.