From 3a6a29b4ecfdb7f641ca699fcd66a09b4baaae6a Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 31 Jul 2019 21:00:35 +0200 Subject: Use associated_type_bounds where applicable - closes #61738 --- src/libstd/sys/sgx/abi/usercalls/alloc.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/sys/sgx/abi/usercalls/alloc.rs b/src/libstd/sys/sgx/abi/usercalls/alloc.rs index c9ff53d0a4f..75dd0d429c2 100644 --- a/src/libstd/sys/sgx/abi/usercalls/alloc.rs +++ b/src/libstd/sys/sgx/abi/usercalls/alloc.rs @@ -522,7 +522,11 @@ impl Drop for User where T: UserSafe { impl, U> CoerceUnsized> for UserRef {} #[unstable(feature = "sgx_platform", issue = "56975")] -impl> Index for UserRef<[T]> where [T]: UserSafe, I::Output: UserSafe { +impl Index for UserRef<[T]> +where + [T]: UserSafe, + I: SliceIndex<[T], Output: UserSafe>, +{ type Output = UserRef; #[inline] @@ -538,7 +542,11 @@ impl> Index for UserRef<[T]> where [T]: UserSafe, I::Ou } #[unstable(feature = "sgx_platform", issue = "56975")] -impl> IndexMut for UserRef<[T]> where [T]: UserSafe, I::Output: UserSafe { +impl IndexMut for UserRef<[T]> +where + [T]: UserSafe, + I: SliceIndex<[T], Output: UserSafe>, +{ #[inline] fn index_mut(&mut self, index: I) -> &mut UserRef { unsafe { -- cgit 1.4.1-3-g733a5 From 3d231acceeb6a1af8108577b65bd60745f7dcf17 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 9 Aug 2019 00:33:57 +0200 Subject: Add missing #![feature(associated_type_bounds)] --- src/liballoc/tests/lib.rs | 1 + src/libcore/iter/traits/collect.rs | 2 ++ src/libstd/lib.rs | 1 + 3 files changed, 4 insertions(+) (limited to 'src/libstd') diff --git a/src/liballoc/tests/lib.rs b/src/liballoc/tests/lib.rs index 6d774f3fecd..5723a30c0f3 100644 --- a/src/liballoc/tests/lib.rs +++ b/src/liballoc/tests/lib.rs @@ -8,6 +8,7 @@ #![feature(trusted_len)] #![feature(try_reserve)] #![feature(unboxed_closures)] +#![feature(associated_type_bounds)] use std::hash::{Hash, Hasher}; use std::collections::hash_map::DefaultHasher; diff --git a/src/libcore/iter/traits/collect.rs b/src/libcore/iter/traits/collect.rs index 9f15de33425..015184cbba2 100644 --- a/src/libcore/iter/traits/collect.rs +++ b/src/libcore/iter/traits/collect.rs @@ -194,6 +194,8 @@ pub trait FromIterator: Sized { /// `Item`: /// /// ```rust +/// #![feature(associated_type_bounds)] +/// /// fn collect_as_strings(collection: T) -> Vec /// where /// T: IntoIterator, diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index cfee49a7b55..10e3c345063 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -238,6 +238,7 @@ #![feature(arbitrary_self_types)] #![feature(array_error_internals)] #![feature(asm)] +#![feature(associated_type_bounds)] #![feature(bind_by_move_pattern_guards)] #![feature(box_syntax)] #![feature(c_variadic)] -- cgit 1.4.1-3-g733a5