@@ -39,7 +39,7 @@ use crate::hash::Hash;
3939/// [`Iterator`]: ../iter/trait.IntoIterator.html
4040/// [slicing index]: ../slice/trait.SliceIndex.html
4141#[ doc( alias = ".." ) ]
42- #[ derive( Copy , Clone , PartialEq , Eq , Hash ) ]
42+ #[ derive( Copy , Clone , Default , PartialEq , Eq , Hash ) ]
4343#[ stable( feature = "rust1" , since = "1.0.0" ) ]
4444pub struct RangeFull ;
4545
@@ -71,7 +71,7 @@ impl fmt::Debug for RangeFull {
7171/// assert_eq!(arr[1..=3], [ 1,2,3 ]);
7272/// ```
7373#[ doc( alias = ".." ) ]
74- #[ derive( Clone , PartialEq , Eq , Hash ) ] // not Copy -- see #27186
74+ #[ derive( Clone , Default , PartialEq , Eq , Hash ) ] // not Copy -- see #27186
7575#[ stable( feature = "rust1" , since = "1.0.0" ) ]
7676pub struct Range < Idx > {
7777 /// The lower bound of the range (inclusive).
@@ -179,7 +179,7 @@ impl<Idx: PartialOrd<Idx>> Range<Idx> {
179179///
180180/// [`Iterator`]: ../iter/trait.IntoIterator.html
181181#[ doc( alias = ".." ) ]
182- #[ derive( Clone , PartialEq , Eq , Hash ) ] // not Copy -- see #27186
182+ #[ derive( Clone , Default , PartialEq , Eq , Hash ) ] // not Copy -- see #27186
183183#[ stable( feature = "rust1" , since = "1.0.0" ) ]
184184pub struct RangeFrom < Idx > {
185185 /// The lower bound of the range (inclusive).
@@ -261,7 +261,7 @@ impl<Idx: PartialOrd<Idx>> RangeFrom<Idx> {
261261/// [`Iterator`]: ../iter/trait.IntoIterator.html
262262/// [slicing index]: ../slice/trait.SliceIndex.html
263263#[ doc( alias = ".." ) ]
264- #[ derive( Copy , Clone , PartialEq , Eq , Hash ) ]
264+ #[ derive( Copy , Clone , Default , PartialEq , Eq , Hash ) ]
265265#[ stable( feature = "rust1" , since = "1.0.0" ) ]
266266pub struct RangeTo < Idx > {
267267 /// The upper bound of the range (exclusive).
@@ -329,7 +329,7 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
329329/// assert_eq!(arr[1..=3], [ 1,2,3 ]); // RangeInclusive
330330/// ```
331331#[ doc( alias = "..=" ) ]
332- #[ derive( Clone , PartialEq , Eq , Hash ) ] // not Copy -- see #27186
332+ #[ derive( Clone , Default , PartialEq , Eq , Hash ) ] // not Copy -- see #27186
333333#[ stable( feature = "inclusive_range" , since = "1.26.0" ) ]
334334pub struct RangeInclusive < Idx > {
335335 // Note that the fields here are not public to allow changing the
@@ -556,7 +556,7 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
556556/// [`Iterator`]: ../iter/trait.IntoIterator.html
557557/// [slicing index]: ../slice/trait.SliceIndex.html
558558#[ doc( alias = "..=" ) ]
559- #[ derive( Copy , Clone , PartialEq , Eq , Hash ) ]
559+ #[ derive( Copy , Clone , Default , PartialEq , Eq , Hash ) ]
560560#[ stable( feature = "inclusive_range" , since = "1.26.0" ) ]
561561pub struct RangeToInclusive < Idx > {
562562 /// The upper bound of the range (inclusive)
0 commit comments