Skip to content

Implement AsRef<Path> for Arc<PathBuf> #58469

Closed as not planned
Closed as not planned
@vitiral

Description

@vitiral

Possibly also implement Borrow and Deref.

I would like to use Arc<PathBuf> to be the equivalent of PathBuf for traits in my library, path_abs.

However, I get errors like this:

751 | impl PathMut for Arc<PathBuf> {
    |      ^^^^^^^ the trait `std::convert::AsRef<std::path::Path>` is not implemented for `alloc::sync::Arc<std::path::PathBuf>`
    |
    = help: the following implementations were found:
              <alloc::sync::Arc<T> as std::convert::AsRef<T>>
    = note: required because of the requirements on the impl of `PathInfo` for `alloc::sync::Arc<std::path::PathBuf>`

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-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