about summary refs log tree commit diff
path: root/src/libregex
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@mozilla.com>2014-06-13 20:48:09 -0700
committerCameron Zwarich <zwarich@mozilla.com>2014-06-13 20:48:09 -0700
commit159e27aebb940926ccf1bad0b2b12087d36ad903 (patch)
treefcbd53189c2eba87584deebc8ce5512d9534f6de /src/libregex
parent036833ece95aa5fc9a1110c5691488193138eb8f (diff)
Fix all violations of stronger guarantees for mutable borrows
Fix all violations in the Rust source tree of the stronger guarantee
of a unique access path for mutable borrows as described in #12624.
Diffstat (limited to 'src/libregex')
-rw-r--r--src/libregex/parse/mod.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libregex/parse/mod.rs b/src/libregex/parse/mod.rs
index 29c807882ec..cedc40df300 100644
--- a/src/libregex/parse/mod.rs
+++ b/src/libregex/parse/mod.rs
@@ -345,18 +345,19 @@ impl<'a> Parser<'a> {
     }
 
     fn push_literal(&mut self, c: char) -> Result<(), Error> {
+        let flags = self.flags;
         match c {
             '.' => {
-                self.push(Dot(self.flags))
+                self.push(Dot(flags))
             }
             '^' => {
-                self.push(Begin(self.flags))
+                self.push(Begin(flags))
             }
             '$' => {
-                self.push(End(self.flags))
+                self.push(End(flags))
             }
             _ => {
-                self.push(Literal(c, self.flags))
+                self.push(Literal(c, flags))
             }
         }
         Ok(())