From 03b4ea463a8b2e45032e9cd6f7e293561b01c3ce Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 27 Dec 2020 01:13:21 +0000 Subject: [PATCH] Mark SlicePattern trait uses as ?Sized This trait is ?Sized and is often slices. Signed-off-by: Ian Jackson --- library/core/src/slice/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 1ab7d68805a..23830548f68 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -1786,7 +1786,7 @@ impl [T] { /// ``` #[must_use = "returns the subslice without modifying the original"] #[stable(feature = "slice_strip", since = "1.50.0")] - pub fn strip_prefix>(&self, prefix: &P) -> Option<&[T]> + pub fn strip_prefix + ?Sized>(&self, prefix: &P) -> Option<&[T]> where T: PartialEq, { @@ -1820,7 +1820,7 @@ impl [T] { /// ``` #[must_use = "returns the subslice without modifying the original"] #[stable(feature = "slice_strip", since = "1.50.0")] - pub fn strip_suffix>(&self, suffix: &P) -> Option<&[T]> + pub fn strip_suffix + ?Sized>(&self, suffix: &P) -> Option<&[T]> where T: PartialEq, {