Skip to content

Commit 0d51e80

Browse files
committed
fix some tidy complaints
1 parent 24ee4b1 commit 0d51e80

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/librustc_mir/build/matches/simplify.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,14 @@ impl<'a,'tcx> Builder<'a,'tcx> {
5656

5757
/// Tries to simplify `match_pair`, returning true if
5858
/// successful. If successful, new match pairs and bindings will
59-
/// have been pushed into the candidate. On failure (if false is
60-
/// returned), no changes are made to candidate.
59+
/// have been pushed into the candidate. If no simplification is
60+
/// possible, Err is returned and no changes are made to
61+
/// candidate.
6162
fn simplify_match_pair(&mut self,
6263
mut block: BasicBlock,
6364
match_pair: MatchPair<'tcx>,
6465
candidate: &mut Candidate<'tcx>)
65-
-> Result<BasicBlock, MatchPair<'tcx>> // returns Err() if cannot simplify
66+
-> Result<BasicBlock, MatchPair<'tcx>>
6667
{
6768
match match_pair.pattern.kind {
6869
PatternKind::Wild(..) => {

src/librustc_mir/build/matches/util.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ impl<'a,'tcx> Builder<'a,'tcx> {
2727
.collect()
2828
}
2929

30-
pub fn match_pair(&mut self, lvalue: Lvalue<'tcx>, pattern: PatternRef<'tcx>) -> MatchPair<'tcx> {
30+
pub fn match_pair(&mut self, lvalue: Lvalue<'tcx>, pattern: PatternRef<'tcx>)
31+
-> MatchPair<'tcx> {
3132
let pattern = self.hir.mirror(pattern);
3233
MatchPair::new(lvalue, pattern)
3334
}

src/librustc_mir/hair.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ pub enum PatternKind<'tcx> {
199199
subpattern: Option<PatternRef<'tcx>> },
200200

201201
// Foo(...) or Foo{...} or Foo, where `Foo` is a variant name from an adt with >1 variants
202-
Variant { adt_def: AdtDef<'tcx>, variant_index: usize, subpatterns: Vec<FieldPatternRef<'tcx>> },
202+
Variant { adt_def: AdtDef<'tcx>,
203+
variant_index: usize,
204+
subpatterns: Vec<FieldPatternRef<'tcx>> },
203205

204206
// (...), Foo(...), Foo{...}, or Foo, where `Foo` is a variant name from an adt with 1 variant
205207
Leaf { subpatterns: Vec<FieldPatternRef<'tcx>> },

0 commit comments

Comments
 (0)