File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,10 @@ pub trait Index<Idx: ?Sized> {
61
61
type Output : ?Sized ;
62
62
63
63
/// Performs the indexing (`container[index]`) operation.
64
+ ///
65
+ /// # Panics
66
+ ///
67
+ /// May panic if the index is out of bounds.
64
68
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
65
69
#[ track_caller]
66
70
fn index ( & self , index : Idx ) -> & Self :: Output ;
@@ -161,6 +165,10 @@ see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#ind
161
165
#[ doc( alias = "[]" ) ]
162
166
pub trait IndexMut < Idx : ?Sized > : Index < Idx > {
163
167
/// Performs the mutable indexing (`container[index]`) operation.
168
+ ///
169
+ /// # Panics
170
+ ///
171
+ /// May panic if the index is out of bounds.
164
172
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
165
173
#[ track_caller]
166
174
fn index_mut ( & mut self , index : Idx ) -> & mut Self :: Output ;
You can’t perform that action at this time.
0 commit comments