@@ -1141,6 +1141,12 @@ impl<'a, T: ?Sized + 'a> RangeBounds<T> for (Bound<&'a T>, Bound<&'a T>) {
1141
1141
}
1142
1142
}
1143
1143
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)`.
1144
1150
#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
1145
1151
impl < T > RangeBounds < T > for RangeFrom < & T > {
1146
1152
fn start_bound ( & self ) -> Bound < & T > {
@@ -1151,6 +1157,11 @@ impl<T> RangeBounds<T> for RangeFrom<&T> {
1151
1157
}
1152
1158
}
1153
1159
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))`.
1154
1165
#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
1155
1166
impl < T > RangeBounds < T > for RangeTo < & T > {
1156
1167
fn start_bound ( & self ) -> Bound < & T > {
@@ -1161,6 +1172,11 @@ impl<T> RangeBounds<T> for RangeTo<&T> {
1161
1172
}
1162
1173
}
1163
1174
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))`.
1164
1180
#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
1165
1181
impl < T > RangeBounds < T > for Range < & T > {
1166
1182
fn start_bound ( & self ) -> Bound < & T > {
@@ -1171,6 +1187,11 @@ impl<T> RangeBounds<T> for Range<&T> {
1171
1187
}
1172
1188
}
1173
1189
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))`.
1174
1195
#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
1175
1196
impl < T > RangeBounds < T > for RangeInclusive < & T > {
1176
1197
fn start_bound ( & self ) -> Bound < & T > {
@@ -1181,6 +1202,11 @@ impl<T> RangeBounds<T> for RangeInclusive<&T> {
1181
1202
}
1182
1203
}
1183
1204
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))`.
1184
1210
#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
1185
1211
impl < T > RangeBounds < T > for RangeToInclusive < & T > {
1186
1212
fn start_bound ( & self ) -> Bound < & T > {
0 commit comments