Skip to content

Double drop in Vec::drain_filter #60977

Closed
@ExpHP

Description

@ExpHP

The following playground originally posted by @rustonaut still demonstrates a double drop in Vec::drain_filter. This is unsound.

https://play.rust-lang.org/?gist=be84e0e74bc2eb86d81a7ad90e612ace&version=nightly&mode=debug

Originating comment: #43244 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-collectionsArea: `std::collections`C-bugCategory: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions