Skip to content

Commit 6751769

Browse files
committed
Fix the bound on U and the feature in the doc test
1 parent 15bc9b6 commit 6751769

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/core/src/slice/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,7 @@ impl<T> [T] {
14121412
/// # Examples
14131413
///
14141414
/// ```
1415+
/// # #![feature(contains_ref)]
14151416
/// let v = [String::from("Hello"), String::from("world")];
14161417
/// assert!(v.contains_ref("Hello"));
14171418
/// assert!(!v.contains_ref("Rust"));
@@ -1420,6 +1421,7 @@ impl<T> [T] {
14201421
pub fn contains_ref<U>(&self, x: &U) -> bool
14211422
where
14221423
T: PartialEq<U>,
1424+
U: ?Sized,
14231425
{
14241426
self.iter().any(|e| e == x)
14251427
}

0 commit comments

Comments
 (0)