Skip to content

Spurious warning in #[allow(clippy::non_send_fields_in_send_ty)] for complex thread-safe wrapper #8275

@alice-i-cecile

Description

@alice-i-cecile

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveL-nurseryLint: Currently in the nursery group

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions