You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>`
The text was updated successfully, but these errors were encountered:
To my understanding, adding new implementations of AsRef for smart pointers like Arc breaks type inference because of how some code currently uses .as_ref(). That said, I still think Arc<PathBuf> should implement AsRef<Path>. But it may be difficult to tackle.
Perhaps this issue could be closed and refer to #45742 for a (hopefully future) general solution of the problem.
Possibly also implement
Borrow
andDeref
.I would like to use
Arc<PathBuf>
to be the equivalent ofPathBuf
for traits in my library,path_abs
.However, I get errors like this:
The text was updated successfully, but these errors were encountered: