@@ -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` due to type inference issues.
1145+ // see https://github.com/rust-lang/rust/pull/61584 for discussion of those issues
1146+ ///
1147+ /// If you need to use this impl where `T` is unsized,
1148+ /// consider using the `RangeBounds` impl for a 2-tuple of [`Bound<&T>`][Bound],
1149+ /// e.g. 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,11 @@ impl<T> RangeBounds<T> for RangeFrom<&T> {
11511157 }
11521158}
11531159
1160+ /// This impl intentionally does not have `T: ?Sized` due to type inference issues.
1161+ ///
1162+ /// If you need to use this impl where `T` is unsized,
1163+ /// consider using the `RangeBounds` impl for a 2-tuple of [`Bound<&T>`][Bound],
1164+ /// e.g. replace `..end` with `(Bound::Unbounded, Bound::Excluded(end))`.
11541165#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
11551166impl < T > RangeBounds < T > for RangeTo < & T > {
11561167 fn start_bound ( & self ) -> Bound < & T > {
@@ -1161,6 +1172,11 @@ impl<T> RangeBounds<T> for RangeTo<&T> {
11611172 }
11621173}
11631174
1175+ /// This impl intentionally does not have `T: ?Sized` due to type inference issues.
1176+ ///
1177+ /// If you need to use this impl where `T` is unsized,
1178+ /// consider using the `RangeBounds` impl for a 2-tuple of [`Bound<&T>`][Bound],
1179+ /// e.g. replace `start..end` with `(Bound::Included(start), Bound::Excluded(end))`.
11641180#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
11651181impl < T > RangeBounds < T > for Range < & T > {
11661182 fn start_bound ( & self ) -> Bound < & T > {
@@ -1171,6 +1187,11 @@ impl<T> RangeBounds<T> for Range<&T> {
11711187 }
11721188}
11731189
1190+ /// This impl intentionally does not have `T: ?Sized` due to type inference issues.
1191+ ///
1192+ /// If you need to use this impl where `T` is unsized,
1193+ /// consider using the `RangeBounds` impl for a 2-tuple of [`Bound<&T>`][Bound],
1194+ /// e.g. replace `start..=end` with `(Bound::Included(start), Bound::Included(end))`.
11741195#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
11751196impl < T > RangeBounds < T > for RangeInclusive < & T > {
11761197 fn start_bound ( & self ) -> Bound < & T > {
@@ -1181,6 +1202,11 @@ impl<T> RangeBounds<T> for RangeInclusive<&T> {
11811202 }
11821203}
11831204
1205+ /// This impl intentionally does not have `T: ?Sized` due to type inference issues.
1206+ ///
1207+ /// If you need to use this impl where `T` is unsized,
1208+ /// consider using the `RangeBounds` impl for a 2-tuple of [`Bound<&T>`][Bound],
1209+ /// e.g. replace `..=end` with `(Bound::Unbounded, Bound::Included(end))`.
11841210#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
11851211impl < T > RangeBounds < T > for RangeToInclusive < & T > {
11861212 fn start_bound ( & self ) -> Bound < & T > {
0 commit comments