diff options
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/borrow.rs | 12 | ||||
| -rw-r--r-- | src/liballoc/lib.rs | 1 | ||||
| -rw-r--r-- | src/liballoc/tests/str.rs | 10 |
3 files changed, 13 insertions, 10 deletions
diff --git a/src/liballoc/borrow.rs b/src/liballoc/borrow.rs index d5e15b3719c..a9c5bce4c25 100644 --- a/src/liballoc/borrow.rs +++ b/src/liballoc/borrow.rs @@ -329,8 +329,8 @@ impl<'a, B: ?Sized> PartialOrd for Cow<'a, B> #[stable(feature = "rust1", since = "1.0.0")] impl<B: ?Sized> fmt::Debug for Cow<'_, B> - where B: fmt::Debug + ToOwned, - <B as ToOwned>::Owned: fmt::Debug +where + B: fmt::Debug + ToOwned<Owned: fmt::Debug>, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match *self { @@ -342,8 +342,8 @@ impl<B: ?Sized> fmt::Debug for Cow<'_, B> #[stable(feature = "rust1", since = "1.0.0")] impl<B: ?Sized> fmt::Display for Cow<'_, B> - where B: fmt::Display + ToOwned, - <B as ToOwned>::Owned: fmt::Display +where + B: fmt::Display + ToOwned<Owned: fmt::Display>, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match *self { @@ -355,8 +355,8 @@ impl<B: ?Sized> fmt::Display for Cow<'_, B> #[stable(feature = "default", since = "1.11.0")] impl<B: ?Sized> Default for Cow<'_, B> - where B: ToOwned, - <B as ToOwned>::Owned: Default +where + B: ToOwned<Owned: Default>, { /// Creates an owned Cow<'a, B> with the default value for the contained owned value. fn default() -> Self { diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index deea74daa52..a1936b36ac6 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -122,6 +122,7 @@ #![feature(alloc_layout_extra)] #![feature(try_trait)] #![feature(mem_take)] +#![feature(associated_type_bounds)] // Allow testing this library diff --git a/src/liballoc/tests/str.rs b/src/liballoc/tests/str.rs index c5198ca39fe..4332b2e90fd 100644 --- a/src/liballoc/tests/str.rs +++ b/src/liballoc/tests/str.rs @@ -1638,10 +1638,12 @@ mod pattern { } } - fn cmp_search_to_vec<'a, P: Pattern<'a>>(rev: bool, pat: P, haystack: &'a str, - right: Vec<SearchStep>) - where P::Searcher: ReverseSearcher<'a> - { + fn cmp_search_to_vec<'a>( + rev: bool, + pat: impl Pattern<'a, Searcher: ReverseSearcher<'a>>, + haystack: &'a str, + right: Vec<SearchStep> + ) { let mut searcher = pat.into_searcher(haystack); let mut v = vec![]; loop { |
