Closed
Description
Hello, my favorite Rust WG :))
At least as of nightly-2022-02-20, Vec<T, A>
does not borrow as [T]
, only Vec<T, Global>
does.
From src/alloc/slice.rs
:
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Borrow<[T]> for Vec<T> {
fn borrow(&self) -> &[T] {
&self[..]
}
}
Which I guess could be:
#[stable(feature = "rust1", since = "1.0.0")]
impl<T, A: Allocator> Borrow<[T]> for Vec<T, A> {
fn borrow(&self) -> &[T] {
&self[..]
}
}
Is this just a missing feature, or is there something fundamental afoot here?
(Need this for querying a hashmap with keys that are String<A>
Vec<u8, A>
... btw anything I can do to make String<A>
happen?)
Metadata
Metadata
Assignees
Labels
No labels