]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/util/snapshot_vec.rs
Merge pull request #20674 from jbcrail/fix-misspelled-comments
[rust.git] / src / librustc / util / snapshot_vec.rs
index 749c39d7a6b92219591dac776430ff97d6686bb9..d68b13aa2ff58587bb28311519a06d5d1a6c644c 100644 (file)
@@ -14,7 +14,7 @@
 //!
 //! This vector is intended to be used as part of an abstraction, not serve as a complete
 //! abstraction on its own. As such, while it will roll back most changes on its own, it also
-//! supports a `get_mut` operation that gives you an abitrary mutable pointer into the vector. To
+//! supports a `get_mut` operation that gives you an arbitrary mutable pointer into the vector. To
 //! ensure that any changes you make this with this pointer are rolled back, you must invoke
 //! `record` to record any changes you make and also supplying a delegate capable of reversing
 //! those changes.
@@ -22,7 +22,7 @@
 
 use std::mem;
 
-#[deriving(PartialEq)]
+#[derive(PartialEq)]
 pub enum UndoLog<T,U> {
     /// Indicates where a snapshot started.
     OpenSnapshot,
@@ -116,7 +116,7 @@ pub fn start_snapshot(&mut self) -> Snapshot {
     pub fn actions_since_snapshot(&self,
                                   snapshot: &Snapshot)
                                   -> &[UndoLog<T,U>] {
-        self.undo_log[snapshot.length..]
+        self.undo_log.index(&(snapshot.length..))
     }
 
     fn assert_open_snapshot(&self, snapshot: &Snapshot) {