@@ -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`;
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)`.
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,12 @@ impl<T> RangeBounds<T> for RangeFrom<&T> {
1151
1157
}
1152
1158
}
1153
1159
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))`.
1154
1166
#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
1155
1167
impl < T > RangeBounds < T > for RangeTo < & T > {
1156
1168
fn start_bound ( & self ) -> Bound < & T > {
@@ -1161,6 +1173,12 @@ impl<T> RangeBounds<T> for RangeTo<&T> {
1161
1173
}
1162
1174
}
1163
1175
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))`.
1164
1182
#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
1165
1183
impl < T > RangeBounds < T > for Range < & T > {
1166
1184
fn start_bound ( & self ) -> Bound < & T > {
@@ -1171,6 +1189,12 @@ impl<T> RangeBounds<T> for Range<&T> {
1171
1189
}
1172
1190
}
1173
1191
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))`.
1174
1198
#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
1175
1199
impl < T > RangeBounds < T > for RangeInclusive < & T > {
1176
1200
fn start_bound ( & self ) -> Bound < & T > {
@@ -1181,6 +1205,12 @@ impl<T> RangeBounds<T> for RangeInclusive<&T> {
1181
1205
}
1182
1206
}
1183
1207
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))`.
1184
1214
#[ stable( feature = "collections_range" , since = "1.28.0" ) ]
1185
1215
impl < T > RangeBounds < T > for RangeToInclusive < & T > {
1186
1216
fn start_bound ( & self ) -> Bound < & T > {
0 commit comments