@@ -1543,6 +1543,7 @@ impl<T: Hash> Hash for Vec<T> {
1543
1543
}
1544
1544
1545
1545
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1546
+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
1546
1547
impl < T > Index < usize > for Vec < T > {
1547
1548
type Output = T ;
1548
1549
@@ -1554,6 +1555,7 @@ impl<T> Index<usize> for Vec<T> {
1554
1555
}
1555
1556
1556
1557
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1558
+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
1557
1559
impl < T > IndexMut < usize > for Vec < T > {
1558
1560
#[ inline]
1559
1561
fn index_mut ( & mut self , index : usize ) -> & mut T {
@@ -1562,8 +1564,8 @@ impl<T> IndexMut<usize> for Vec<T> {
1562
1564
}
1563
1565
}
1564
1566
1565
-
1566
1567
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1568
+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
1567
1569
impl < T > ops:: Index < ops:: Range < usize > > for Vec < T > {
1568
1570
type Output = [ T ] ;
1569
1571
@@ -1572,7 +1574,9 @@ impl<T> ops::Index<ops::Range<usize>> for Vec<T> {
1572
1574
Index :: index ( & * * self , index)
1573
1575
}
1574
1576
}
1577
+
1575
1578
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1579
+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
1576
1580
impl < T > ops:: Index < ops:: RangeTo < usize > > for Vec < T > {
1577
1581
type Output = [ T ] ;
1578
1582
@@ -1581,7 +1585,9 @@ impl<T> ops::Index<ops::RangeTo<usize>> for Vec<T> {
1581
1585
Index :: index ( & * * self , index)
1582
1586
}
1583
1587
}
1588
+
1584
1589
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1590
+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
1585
1591
impl < T > ops:: Index < ops:: RangeFrom < usize > > for Vec < T > {
1586
1592
type Output = [ T ] ;
1587
1593
@@ -1590,7 +1596,9 @@ impl<T> ops::Index<ops::RangeFrom<usize>> for Vec<T> {
1590
1596
Index :: index ( & * * self , index)
1591
1597
}
1592
1598
}
1599
+
1593
1600
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1601
+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
1594
1602
impl < T > ops:: Index < ops:: RangeFull > for Vec < T > {
1595
1603
type Output = [ T ] ;
1596
1604
@@ -1599,7 +1607,9 @@ impl<T> ops::Index<ops::RangeFull> for Vec<T> {
1599
1607
self
1600
1608
}
1601
1609
}
1610
+
1602
1611
#[ 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`" ]
1603
1613
impl < T > ops:: Index < ops:: RangeInclusive < usize > > for Vec < T > {
1604
1614
type Output = [ T ] ;
1605
1615
@@ -1608,7 +1618,9 @@ impl<T> ops::Index<ops::RangeInclusive<usize>> for Vec<T> {
1608
1618
Index :: index ( & * * self , index)
1609
1619
}
1610
1620
}
1621
+
1611
1622
#[ 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`" ]
1612
1624
impl < T > ops:: Index < ops:: RangeToInclusive < usize > > for Vec < T > {
1613
1625
type Output = [ T ] ;
1614
1626
@@ -1619,41 +1631,52 @@ impl<T> ops::Index<ops::RangeToInclusive<usize>> for Vec<T> {
1619
1631
}
1620
1632
1621
1633
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1634
+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
1622
1635
impl < T > ops:: IndexMut < ops:: Range < usize > > for Vec < T > {
1623
1636
#[ inline]
1624
1637
fn index_mut ( & mut self , index : ops:: Range < usize > ) -> & mut [ T ] {
1625
1638
IndexMut :: index_mut ( & mut * * self , index)
1626
1639
}
1627
1640
}
1641
+
1628
1642
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1643
+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
1629
1644
impl < T > ops:: IndexMut < ops:: RangeTo < usize > > for Vec < T > {
1630
1645
#[ inline]
1631
1646
fn index_mut ( & mut self , index : ops:: RangeTo < usize > ) -> & mut [ T ] {
1632
1647
IndexMut :: index_mut ( & mut * * self , index)
1633
1648
}
1634
1649
}
1650
+
1635
1651
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1652
+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
1636
1653
impl < T > ops:: IndexMut < ops:: RangeFrom < usize > > for Vec < T > {
1637
1654
#[ inline]
1638
1655
fn index_mut ( & mut self , index : ops:: RangeFrom < usize > ) -> & mut [ T ] {
1639
1656
IndexMut :: index_mut ( & mut * * self , index)
1640
1657
}
1641
1658
}
1659
+
1642
1660
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1661
+ #[ rustc_on_unimplemented = "vector indices are of type `usize` or ranges of `usize`" ]
1643
1662
impl < T > ops:: IndexMut < ops:: RangeFull > for Vec < T > {
1644
1663
#[ inline]
1645
1664
fn index_mut ( & mut self , _index : ops:: RangeFull ) -> & mut [ T ] {
1646
1665
self
1647
1666
}
1648
1667
}
1668
+
1649
1669
#[ 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`" ]
1650
1671
impl < T > ops:: IndexMut < ops:: RangeInclusive < usize > > for Vec < T > {
1651
1672
#[ inline]
1652
1673
fn index_mut ( & mut self , index : ops:: RangeInclusive < usize > ) -> & mut [ T ] {
1653
1674
IndexMut :: index_mut ( & mut * * self , index)
1654
1675
}
1655
1676
}
1677
+
1656
1678
#[ 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`" ]
1657
1680
impl < T > ops:: IndexMut < ops:: RangeToInclusive < usize > > for Vec < T > {
1658
1681
#[ inline]
1659
1682
fn index_mut ( & mut self , index : ops:: RangeToInclusive < usize > ) -> & mut [ T ] {
0 commit comments