File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 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> {
6161 type Output : ?Sized ;
6262
6363 /// Performs the indexing (`container[index]`) operation.
64+ ///
65+ /// # Panics
66+ ///
67+ /// May panic if the index is out of bounds.
6468 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
6569 #[ track_caller]
6670 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
161165#[ doc( alias = "[]" ) ]
162166pub trait IndexMut < Idx : ?Sized > : Index < Idx > {
163167 /// Performs the mutable indexing (`container[index]`) operation.
168+ ///
169+ /// # Panics
170+ ///
171+ /// May panic if the index is out of bounds.
164172 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
165173 #[ track_caller]
166174 fn index_mut ( & mut self , index : Idx ) -> & mut Self :: Output ;
You can’t perform that action at this time.
0 commit comments