Skip to content

Commit ebade90

Browse files
committed
loosen the bounds on PointeeSized impls
1 parent 35657c0 commit ebade90

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

library/core/src/ops/unsize.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,34 +39,34 @@ pub trait CoerceUnsized<T: PointeeSized> {
3939

4040
// &mut T -> &mut U
4141
#[unstable(feature = "coerce_unsized", issue = "18598")]
42-
impl<'a, T: PointeeSized + Unsize<U>, U: PointeeSized> CoerceUnsized<&'a mut U> for &'a mut T {}
42+
impl<'a, T: PointeeSized + ?crate::marker::Move + Unsize<U>, U: PointeeSized> CoerceUnsized<&'a mut U> for &'a mut T {}
4343
// &mut T -> &U
4444
#[unstable(feature = "coerce_unsized", issue = "18598")]
45-
impl<'a, 'b: 'a, T: PointeeSized + Unsize<U>, U: PointeeSized> CoerceUnsized<&'a U> for &'b mut T {}
45+
impl<'a, 'b: 'a, T: PointeeSized + ?crate::marker::Move + Unsize<U>, U: PointeeSized> CoerceUnsized<&'a U> for &'b mut T {}
4646
// &mut T -> *mut U
4747
#[unstable(feature = "coerce_unsized", issue = "18598")]
48-
impl<'a, T: PointeeSized + Unsize<U>, U: PointeeSized> CoerceUnsized<*mut U> for &'a mut T {}
48+
impl<'a, T: PointeeSized + ?crate::marker::Move + Unsize<U>, U: PointeeSized> CoerceUnsized<*mut U> for &'a mut T {}
4949
// &mut T -> *const U
5050
#[unstable(feature = "coerce_unsized", issue = "18598")]
51-
impl<'a, T: PointeeSized + Unsize<U>, U: PointeeSized> CoerceUnsized<*const U> for &'a mut T {}
51+
impl<'a, T: PointeeSized + ?crate::marker::Move + Unsize<U>, U: PointeeSized> CoerceUnsized<*const U> for &'a mut T {}
5252

5353
// &T -> &U
5454
#[unstable(feature = "coerce_unsized", issue = "18598")]
55-
impl<'a, 'b: 'a, T: PointeeSized + Unsize<U>, U: PointeeSized> CoerceUnsized<&'a U> for &'b T {}
55+
impl<'a, 'b: 'a, T: PointeeSized + ?crate::marker::Move + Unsize<U>, U: PointeeSized> CoerceUnsized<&'a U> for &'b T {}
5656
// &T -> *const U
5757
#[unstable(feature = "coerce_unsized", issue = "18598")]
58-
impl<'a, T: PointeeSized + Unsize<U>, U: PointeeSized> CoerceUnsized<*const U> for &'a T {}
58+
impl<'a, T: PointeeSized + ?crate::marker::Move + Unsize<U>, U: PointeeSized> CoerceUnsized<*const U> for &'a T {}
5959

6060
// *mut T -> *mut U
6161
#[unstable(feature = "coerce_unsized", issue = "18598")]
62-
impl<T: PointeeSized + Unsize<U>, U: PointeeSized> CoerceUnsized<*mut U> for *mut T {}
62+
impl<T: PointeeSized + ?crate::marker::Move + Unsize<U>, U: PointeeSized> CoerceUnsized<*mut U> for *mut T {}
6363
// *mut T -> *const U
6464
#[unstable(feature = "coerce_unsized", issue = "18598")]
65-
impl<T: PointeeSized + Unsize<U>, U: PointeeSized> CoerceUnsized<*const U> for *mut T {}
65+
impl<T: PointeeSized + ?crate::marker::Move + Unsize<U>, U: PointeeSized> CoerceUnsized<*const U> for *mut T {}
6666

6767
// *const T -> *const U
6868
#[unstable(feature = "coerce_unsized", issue = "18598")]
69-
impl<T: PointeeSized + Unsize<U>, U: PointeeSized> CoerceUnsized<*const U> for *const T {}
69+
impl<T: PointeeSized + ?crate::marker::Move + Unsize<U>, U: PointeeSized> CoerceUnsized<*const U> for *const T {}
7070

7171
/// `DispatchFromDyn` is used in the implementation of dyn-compatibility[^1] checks (specifically
7272
/// allowing arbitrary self types), to guarantee that a method's receiver type can be dispatched on.
@@ -122,13 +122,13 @@ pub trait DispatchFromDyn<T: ?crate::marker::Move> {
122122

123123
// &T -> &U
124124
#[unstable(feature = "dispatch_from_dyn", issue = "none")]
125-
impl<'a, T: PointeeSized + Unsize<U>, U: PointeeSized> DispatchFromDyn<&'a U> for &'a T {}
125+
impl<'a, T: PointeeSized + ?crate::marker::Move + Unsize<U>, U: PointeeSized> DispatchFromDyn<&'a U> for &'a T {}
126126
// &mut T -> &mut U
127127
#[unstable(feature = "dispatch_from_dyn", issue = "none")]
128-
impl<'a, T: PointeeSized + Unsize<U>, U: PointeeSized> DispatchFromDyn<&'a mut U> for &'a mut T {}
128+
impl<'a, T: PointeeSized + ?crate::marker::Move + Unsize<U>, U: PointeeSized> DispatchFromDyn<&'a mut U> for &'a mut T {}
129129
// *const T -> *const U
130130
#[unstable(feature = "dispatch_from_dyn", issue = "none")]
131-
impl<T: PointeeSized + Unsize<U>, U: PointeeSized> DispatchFromDyn<*const U> for *const T {}
131+
impl<T: PointeeSized + ?crate::marker::Move + Unsize<U>, U: PointeeSized> DispatchFromDyn<*const U> for *const T {}
132132
// *mut T -> *mut U
133133
#[unstable(feature = "dispatch_from_dyn", issue = "none")]
134-
impl<T: PointeeSized + Unsize<U>, U: PointeeSized> DispatchFromDyn<*mut U> for *mut T {}
134+
impl<T: PointeeSized + ?crate::marker::Move + Unsize<U>, U: PointeeSized> DispatchFromDyn<*mut U> for *mut T {}

0 commit comments

Comments
 (0)