From c063e4d24b36f5d7b9946f1218e26c21ce79b569 Mon Sep 17 00:00:00 2001 From: SparkyPotato Date: Mon, 11 Apr 2022 14:37:14 +0530 Subject: [PATCH] add Allocator bound on Borrow and BorrowMut impl for Vec --- library/alloc/src/slice.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/alloc/src/slice.rs b/library/alloc/src/slice.rs index 31edbe0c5afd5..727cfde1aa722 100644 --- a/library/alloc/src/slice.rs +++ b/library/alloc/src/slice.rs @@ -834,14 +834,14 @@ impl> Join<&[T]> for [V] { //////////////////////////////////////////////////////////////////////////////// #[stable(feature = "rust1", since = "1.0.0")] -impl Borrow<[T]> for Vec { +impl Borrow<[T]> for Vec { fn borrow(&self) -> &[T] { &self[..] } } #[stable(feature = "rust1", since = "1.0.0")] -impl BorrowMut<[T]> for Vec { +impl BorrowMut<[T]> for Vec { fn borrow_mut(&mut self) -> &mut [T] { &mut self[..] }