fix some tidy complaints

This commit is contained in:
Niko Matsakis 2015-10-06 14:58:15 -04:00
parent 24ee4b1f6c
commit 0d51e80b6d
3 changed files with 9 additions and 5 deletions

View File

@ -56,13 +56,14 @@ impl<'a,'tcx> Builder<'a,'tcx> {
/// 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(..) => {

View File

@ -27,7 +27,8 @@ impl<'a,'tcx> Builder<'a,'tcx> {
.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)
}

View 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>> },