@@ -1141,6 +1141,12 @@ impl<'a, T: ?Sized + 'a> RangeBounds<T> for (Bound<&'a T>, Bound<&'a T>) {
11411141 }
11421142}
11431143
1144+ // This impl intentionally does not have `T: ?Sized`;
1145+ // see https://github.com/rust-lang/rust/pull/61584 for discussion of why.
1146+ //
1147+ /// If you need to use this implementation where `T` is unsized,
1148+ /// consider using the `RangeBounds` impl for a 2-tuple of [`Bound<&T>`][Bound],
1149+ /// i.e. replace `start..` with `(Bound::Included(start), Bound::Unbounded)`.
11441150#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
11451151impl < T > RangeBounds < T > for RangeFrom < & T > {
11461152 fn start_bound ( & self ) -> Bound < & T > {
@@ -1151,6 +1157,12 @@ impl<T> RangeBounds<T> for RangeFrom<&T> {
11511157 }
11521158}
11531159
1160+ // This impl intentionally does not have `T: ?Sized`;
1161+ // see https://github.com/rust-lang/rust/pull/61584 for discussion of why.
1162+ //
1163+ /// If you need to use this implementation where `T` is unsized,
1164+ /// consider using the `RangeBounds` impl for a 2-tuple of [`Bound<&T>`][Bound],
1165+ /// i.e. replace `..end` with `(Bound::Unbounded, Bound::Excluded(end))`.
11541166#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
11551167impl < T > RangeBounds < T > for RangeTo < & T > {
11561168 fn start_bound ( & self ) -> Bound < & T > {
@@ -1161,6 +1173,12 @@ impl<T> RangeBounds<T> for RangeTo<&T> {
11611173 }
11621174}
11631175
1176+ // This impl intentionally does not have `T: ?Sized`;
1177+ // see https://github.com/rust-lang/rust/pull/61584 for discussion of why.
1178+ //
1179+ /// If you need to use this implementation where `T` is unsized,
1180+ /// consider using the `RangeBounds` impl for a 2-tuple of [`Bound<&T>`][Bound],
1181+ /// i.e. replace `start..end` with `(Bound::Included(start), Bound::Excluded(end))`.
11641182#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
11651183impl < T > RangeBounds < T > for Range < & T > {
11661184 fn start_bound ( & self ) -> Bound < & T > {
@@ -1171,6 +1189,12 @@ impl<T> RangeBounds<T> for Range<&T> {
11711189 }
11721190}
11731191
1192+ // This impl intentionally does not have `T: ?Sized`;
1193+ // see https://github.com/rust-lang/rust/pull/61584 for discussion of why.
1194+ //
1195+ /// If you need to use this implementation where `T` is unsized,
1196+ /// consider using the `RangeBounds` impl for a 2-tuple of [`Bound<&T>`][Bound],
1197+ /// i.e. replace `start..=end` with `(Bound::Included(start), Bound::Included(end))`.
11741198#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
11751199impl < T > RangeBounds < T > for RangeInclusive < & T > {
11761200 fn start_bound ( & self ) -> Bound < & T > {
@@ -1181,6 +1205,12 @@ impl<T> RangeBounds<T> for RangeInclusive<&T> {
11811205 }
11821206}
11831207
1208+ // This impl intentionally does not have `T: ?Sized`;
1209+ // see https://github.com/rust-lang/rust/pull/61584 for discussion of why.
1210+ //
1211+ /// If you need to use this implementation where `T` is unsized,
1212+ /// consider using the `RangeBounds` impl for a 2-tuple of [`Bound<&T>`][Bound],
1213+ /// i.e. replace `..=end` with `(Bound::Unbounded, Bound::Included(end))`.
11841214#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
11851215impl < T > RangeBounds < T > for RangeToInclusive < & T > {
11861216 fn start_bound ( & self ) -> Bound < & T > {
0 commit comments