@@ -1543,6 +1543,7 @@ impl<T: Hash> Hash for Vec<T> {
15431543}
15441544
15451545#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1546+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
15461547impl < T > Index < usize > for Vec < T > {
15471548 type Output = T ;
15481549
@@ -1554,6 +1555,7 @@ impl<T> Index<usize> for Vec<T> {
15541555}
15551556
15561557#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1558+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
15571559impl < T > IndexMut < usize > for Vec < T > {
15581560 #[ inline]
15591561 fn index_mut ( & mut self , index : usize ) -> & mut T {
@@ -1562,8 +1564,8 @@ impl<T> IndexMut<usize> for Vec<T> {
15621564 }
15631565}
15641566
1565-
15661567#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1568+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
15671569impl < T > ops:: Index < ops:: Range < usize > > for Vec < T > {
15681570 type Output = [ T ] ;
15691571
@@ -1572,7 +1574,9 @@ impl<T> ops::Index<ops::Range<usize>> for Vec<T> {
15721574 Index :: index ( & * * self , index)
15731575 }
15741576}
1577+
15751578#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1579+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
15761580impl < T > ops:: Index < ops:: RangeTo < usize > > for Vec < T > {
15771581 type Output = [ T ] ;
15781582
@@ -1581,7 +1585,9 @@ impl<T> ops::Index<ops::RangeTo<usize>> for Vec<T> {
15811585 Index :: index ( & * * self , index)
15821586 }
15831587}
1588+
15841589#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1590+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
15851591impl < T > ops:: Index < ops:: RangeFrom < usize > > for Vec < T > {
15861592 type Output = [ T ] ;
15871593
@@ -1590,7 +1596,9 @@ impl<T> ops::Index<ops::RangeFrom<usize>> for Vec<T> {
15901596 Index :: index ( & * * self , index)
15911597 }
15921598}
1599+
15931600#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1601+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
15941602impl < T > ops:: Index < ops:: RangeFull > for Vec < T > {
15951603 type Output = [ T ] ;
15961604
@@ -1599,7 +1607,9 @@ impl<T> ops::Index<ops::RangeFull> for Vec<T> {
15991607 self
16001608 }
16011609}
1610+
16021611#[ unstable( feature = "inclusive_range" , reason = "recently added, follows RFC" , issue = "28237" ) ]
1612+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
16031613impl < T > ops:: Index < ops:: RangeInclusive < usize > > for Vec < T > {
16041614 type Output = [ T ] ;
16051615
@@ -1608,7 +1618,9 @@ impl<T> ops::Index<ops::RangeInclusive<usize>> for Vec<T> {
16081618 Index :: index ( & * * self , index)
16091619 }
16101620}
1621+
16111622#[ unstable( feature = "inclusive_range" , reason = "recently added, follows RFC" , issue = "28237" ) ]
1623+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
16121624impl < T > ops:: Index < ops:: RangeToInclusive < usize > > for Vec < T > {
16131625 type Output = [ T ] ;
16141626
@@ -1619,41 +1631,52 @@ impl<T> ops::Index<ops::RangeToInclusive<usize>> for Vec<T> {
16191631}
16201632
16211633#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1634+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
16221635impl < T > ops:: IndexMut < ops:: Range < usize > > for Vec < T > {
16231636 #[ inline]
16241637 fn index_mut ( & mut self , index : ops:: Range < usize > ) -> & mut [ T ] {
16251638 IndexMut :: index_mut ( & mut * * self , index)
16261639 }
16271640}
1641+
16281642#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1643+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
16291644impl < T > ops:: IndexMut < ops:: RangeTo < usize > > for Vec < T > {
16301645 #[ inline]
16311646 fn index_mut ( & mut self , index : ops:: RangeTo < usize > ) -> & mut [ T ] {
16321647 IndexMut :: index_mut ( & mut * * self , index)
16331648 }
16341649}
1650+
16351651#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1652+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
16361653impl < T > ops:: IndexMut < ops:: RangeFrom < usize > > for Vec < T > {
16371654 #[ inline]
16381655 fn index_mut ( & mut self , index : ops:: RangeFrom < usize > ) -> & mut [ T ] {
16391656 IndexMut :: index_mut ( & mut * * self , index)
16401657 }
16411658}
1659+
16421660#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1661+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
16431662impl < T > ops:: IndexMut < ops:: RangeFull > for Vec < T > {
16441663 #[ inline]
16451664 fn index_mut ( & mut self , _index : ops:: RangeFull ) -> & mut [ T ] {
16461665 self
16471666 }
16481667}
1668+
16491669#[ unstable( feature = "inclusive_range" , reason = "recently added, follows RFC" , issue = "28237" ) ]
1670+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
16501671impl < T > ops:: IndexMut < ops:: RangeInclusive < usize > > for Vec < T > {
16511672 #[ inline]
16521673 fn index_mut ( & mut self , index : ops:: RangeInclusive < usize > ) -> & mut [ T ] {
16531674 IndexMut :: index_mut ( & mut * * self , index)
16541675 }
16551676}
1677+
16561678#[ unstable( feature = "inclusive_range" , reason = "recently added, follows RFC" , issue = "28237" ) ]
1679+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
16571680impl < T > ops:: IndexMut < ops:: RangeToInclusive < usize > > for Vec < T > {
16581681 #[ inline]
16591682 fn index_mut ( & mut self , index : ops:: RangeToInclusive < usize > ) -> & mut [ T ] {
0 commit comments