]> git.lizzy.rs Git - rust.git/commitdiff
fix some tidy complaints
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 6 Oct 2015 18:58:15 +0000 (14:58 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Tue, 6 Oct 2015 18:58:15 +0000 (14:58 -0400)
src/librustc_mir/build/matches/simplify.rs
src/librustc_mir/build/matches/util.rs
src/librustc_mir/hair.rs

index 9114463d61d2deef86f1ab016be0aaf6ebd92478..69c7fd6598a84efbfafa970993f16c8d7ef3547f 100644 (file)
@@ -56,13 +56,14 @@ pub fn simplify_candidate(&mut self,
 
     /// Tries to simplify `match_pair`, returning true if
     /// successful. If successful, new match pairs and bindings will
-    /// have been pushed into the candidate. On failure (if false is
-    /// returned), no changes are made to candidate.
+    /// have been pushed into the candidate. If no simplification is
+    /// possible, Err is returned and no changes are made to
+    /// candidate.
     fn simplify_match_pair(&mut self,
                            mut block: BasicBlock,
                            match_pair: MatchPair<'tcx>,
                            candidate: &mut Candidate<'tcx>)
-                           -> Result<BasicBlock, MatchPair<'tcx>> // returns Err() if cannot simplify
+                           -> Result<BasicBlock, MatchPair<'tcx>>
     {
         match match_pair.pattern.kind {
             PatternKind::Wild(..) => {
index d6cc1d088f9e32a0e52b37bf895baee780414365..ae6dc9918f44299c2c09a32dfa3f86d421cbeb34 100644 (file)
@@ -27,7 +27,8 @@ pub fn field_match_pairs(&mut self,
                    .collect()
     }
 
-    pub fn match_pair(&mut self, lvalue: Lvalue<'tcx>, pattern: PatternRef<'tcx>) -> MatchPair<'tcx> {
+    pub fn match_pair(&mut self, lvalue: Lvalue<'tcx>, pattern: PatternRef<'tcx>)
+                      -> MatchPair<'tcx> {
         let pattern = self.hir.mirror(pattern);
         MatchPair::new(lvalue, pattern)
     }
index ed776717d37874001a94056637afa7426dad8ff8..967ffa5edb1c6fd8e4b1f7bee6e2b8e45c05548c 100644 (file)
@@ -199,7 +199,9 @@ pub enum PatternKind<'tcx> {
               subpattern: Option<PatternRef<'tcx>> },
 
     // Foo(...) or Foo{...} or Foo, where `Foo` is a variant name from an adt with >1 variants
-    Variant { adt_def: AdtDef<'tcx>, variant_index: usize, subpatterns: Vec<FieldPatternRef<'tcx>> },
+    Variant { adt_def: AdtDef<'tcx>,
+              variant_index: usize,
+              subpatterns: Vec<FieldPatternRef<'tcx>> },
 
     // (...), Foo(...), Foo{...}, or Foo, where `Foo` is a variant name from an adt with 1 variant
     Leaf { subpatterns: Vec<FieldPatternRef<'tcx>> },