fix some tidy complaints
This commit is contained in:
parent
24ee4b1f6c
commit
0d51e80b6d
@ -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(..) => {
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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>> },
|
||||
|
Loading…
Reference in New Issue
Block a user