diff options
Diffstat (limited to 'crates/ide_ssr/src/matching.rs')
-rw-r--r-- | crates/ide_ssr/src/matching.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide_ssr/src/matching.rs b/crates/ide_ssr/src/matching.rs index b3072fb9f..fb92a0ccc 100644 --- a/crates/ide_ssr/src/matching.rs +++ b/crates/ide_ssr/src/matching.rs | |||
@@ -382,7 +382,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> { | |||
382 | code: Option<T>, | 382 | code: Option<T>, |
383 | ) -> Result<(), MatchFailed> { | 383 | ) -> Result<(), MatchFailed> { |
384 | match (pattern, code) { | 384 | match (pattern, code) { |
385 | (Some(p), Some(c)) => self.attempt_match_node(phase, &p.syntax(), &c.syntax()), | 385 | (Some(p), Some(c)) => self.attempt_match_node(phase, p.syntax(), c.syntax()), |
386 | (None, None) => Ok(()), | 386 | (None, None) => Ok(()), |
387 | (Some(p), None) => fail_match!("Pattern `{}` had nothing to match", p.syntax().text()), | 387 | (Some(p), None) => fail_match!("Pattern `{}` had nothing to match", p.syntax().text()), |
388 | (None, Some(c)) => { | 388 | (None, Some(c)) => { |
@@ -478,7 +478,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> { | |||
478 | if Some(first_token.text()) == next_pattern_token.as_deref() { | 478 | if Some(first_token.text()) == next_pattern_token.as_deref() { |
479 | if let Some(SyntaxElement::Node(p)) = pattern.next() { | 479 | if let Some(SyntaxElement::Node(p)) = pattern.next() { |
480 | // We have a subtree that starts with the next token in our pattern. | 480 | // We have a subtree that starts with the next token in our pattern. |
481 | self.attempt_match_token_tree(phase, &p, &n)?; | 481 | self.attempt_match_token_tree(phase, &p, n)?; |
482 | break; | 482 | break; |
483 | } | 483 | } |
484 | } | 484 | } |
@@ -609,7 +609,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> { | |||
609 | expr: &ast::Expr, | 609 | expr: &ast::Expr, |
610 | ) -> Result<usize, MatchFailed> { | 610 | ) -> Result<usize, MatchFailed> { |
611 | use hir::HirDisplay; | 611 | use hir::HirDisplay; |
612 | let code_type = self.sema.type_of_expr(&expr).ok_or_else(|| { | 612 | let code_type = self.sema.type_of_expr(expr).ok_or_else(|| { |
613 | match_error!("Failed to get receiver type for `{}`", expr.syntax().text()) | 613 | match_error!("Failed to get receiver type for `{}`", expr.syntax().text()) |
614 | })?; | 614 | })?; |
615 | // Temporary needed to make the borrow checker happy. | 615 | // Temporary needed to make the borrow checker happy. |