Skip to content

HashMap<K,V> is always Send/Sync #21763

Closed
@talchas

Description

@talchas
trait Foo: Send {}
impl Foo for HashMap<Rc<()>, Rc<()>> {}

This compiles, despite Rc : !Send. I'm guessing this is because RawTable only uses K and V with marker::CovariantType, and I guess that isn't enough for the negative-impl to propagate. I haven't checked which other collections might be unsafe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions