aboutsummaryrefslogtreecommitdiff
path: root/crates/ssr/src/matching.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-08-21 18:15:09 +0100
committerGitHub <[email protected]>2020-08-21 18:15:09 +0100
commitaab5aaccf2b1af8f1820a244a2c293c7460f9eb6 (patch)
tree60f971e2be8341c7759defc6662f83d6c47d0fdd /crates/ssr/src/matching.rs
parentdf54561a689a9eb7b1962b69a397a1221200c116 (diff)
parent95f33bb5f73a7f9b7922eef14b996c0a489a6404 (diff)
Merge #5838
5838: :arrow_up: autocfg r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ssr/src/matching.rs')
-rw-r--r--crates/ssr/src/matching.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ssr/src/matching.rs b/crates/ssr/src/matching.rs
index 26968c474..948862a77 100644
--- a/crates/ssr/src/matching.rs
+++ b/crates/ssr/src/matching.rs
@@ -546,10 +546,12 @@ impl<'db, 'sema> Matcher<'db, 'sema> {
546 // information on the placeholder match about autoderef and autoref. This allows us to use 546 // information on the placeholder match about autoderef and autoref. This allows us to use
547 // the placeholder in a context where autoderef and autoref don't apply. 547 // the placeholder in a context where autoderef and autoref don't apply.
548 if code_resolved_function.self_param(self.sema.db).is_some() { 548 if code_resolved_function.self_param(self.sema.db).is_some() {
549 if let (Some(pattern_type), Some(expr)) = (&pattern_ufcs.qualifier_type, &code.expr()) { 549 if let (Some(pattern_type), Some(expr)) =
550 (&pattern_ufcs.qualifier_type, &code.receiver())
551 {
550 let deref_count = self.check_expr_type(pattern_type, expr)?; 552 let deref_count = self.check_expr_type(pattern_type, expr)?;
551 let pattern_receiver = pattern_args.next(); 553 let pattern_receiver = pattern_args.next();
552 self.attempt_match_opt(phase, pattern_receiver.clone(), code.expr())?; 554 self.attempt_match_opt(phase, pattern_receiver.clone(), code.receiver())?;
553 if let Phase::Second(match_out) = phase { 555 if let Phase::Second(match_out) = phase {
554 if let Some(placeholder_value) = pattern_receiver 556 if let Some(placeholder_value) = pattern_receiver
555 .and_then(|n| self.get_placeholder_for_node(n.syntax())) 557 .and_then(|n| self.get_placeholder_for_node(n.syntax()))
@@ -568,7 +570,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> {
568 } 570 }
569 } 571 }
570 } else { 572 } else {
571 self.attempt_match_opt(phase, pattern_args.next(), code.expr())?; 573 self.attempt_match_opt(phase, pattern_args.next(), code.receiver())?;
572 } 574 }
573 let mut code_args = 575 let mut code_args =
574 code.arg_list().ok_or_else(|| match_error!("Code method call has no args"))?.args(); 576 code.arg_list().ok_or_else(|| match_error!("Code method call has no args"))?.args();