Skip to content

Why so many lifetimes? #7342

Closed as not planned
Closed as not planned
@dpc

Description

@dpc

I'm sorry for bothering you, but I'm interacting with cargo library a lot and I can't help but wonder - why is there so many complications in the API? There are many lifetimes, RefCells (that make stuff !Sync etc.

Like, why can't Config be taken by move so that Workspace and bunch of other structs doesn't require lifetime? Why not just Arc<Mutex<_>> stuff instead of playing with RefCells? I don't think there's much performance wins to be had in the code that will always be blocked on IO anyway. Is there something I am missing here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cargo-apiArea: cargo-the-library API and internal code issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions