From 436ce07eedae4db7e0138d3d8d55d8666b2ba3a4 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 5 Jan 2024 18:46:57 -0800 Subject: [PATCH] Add link to dead_code autotrait bug https://github.com/rust-lang/rust/issues/119645 --- src/marker.rs | 5 ++++- tests/ui/test-not-send.stderr | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/marker.rs b/src/marker.rs index 25c1555..e8874bd 100644 --- a/src/marker.rs +++ b/src/marker.rs @@ -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 + Rc<()>, +); impl UnwindSafe for ProcMacroAutoTraits {} impl RefUnwindSafe for ProcMacroAutoTraits {} diff --git a/tests/ui/test-not-send.stderr b/tests/ui/test-not-send.stderr index d215533..abaab5a 100644 --- a/tests/ui/test-not-send.stderr +++ b/tests/ui/test-not-send.stderr @@ -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` --> $RUST/core/src/marker.rs