diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 1ab7d68805ab..23830548f68d 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, {