-
Notifications
You must be signed in to change notification settings - Fork 2k
Spurious warning in #[allow(clippy::non_send_fields_in_send_ty)] for complex thread-safe wrapper #8275
Copy link
Copy link
Open
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't haveL-nurseryLint: Currently in the nursery groupLint: Currently in the nursery group
Description
Summary
Our unsafe implementation of Send for a wrapper type that deliberately strips out all of the !Send components of our complex collection tripped the new clippy lint. This was, in fact the entire point of the type, and why we used an unsafe impl block.
Ping @DJMcNab, the author of that PR.
Lint Name
#[allow(clippy::non_send_fields_in_send_ty)]
Reproducer
See bevyengine/bevy#3519 for the case where this lint triggered spuriously.
The existing warning on World was correct: this impl was in fact unsound, and this PR was an attempt to solve that problem.
Version
rustc 1.60.0-nightly (1bd4fdc94 2022-01-12)
binary: rustc
commit-hash: 1bd4fdc943513e1004f498bbf289279c9784fc6f
commit-date: 2022-01-12
host: x86_64-pc-windows-msvc
release: 1.60.0-nightly
LLVM version: 13.0.0
Additional Labels
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't haveL-nurseryLint: Currently in the nursery groupLint: Currently in the nursery group
Type
Fields
Give feedbackNo fields configured for issues without a type.