aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/source_binder.rs18
1 files changed, 8 insertions, 10 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs
index cf9a9e108..2c4cedd8b 100644
--- a/crates/ra_hir/src/source_binder.rs
+++ b/crates/ra_hir/src/source_binder.rs
@@ -428,20 +428,18 @@ impl SourceAnalyzer {
428 let std_future_trait = 428 let std_future_trait =
429 match self.resolver.resolve_path_segments(db, &std_future_path).into_fully_resolved() { 429 match self.resolver.resolve_path_segments(db, &std_future_path).into_fully_resolved() {
430 PerNs { types: Some(Resolution::Def(ModuleDef::Trait(trait_))), .. } => { 430 PerNs { types: Some(Resolution::Def(ModuleDef::Trait(trait_))), .. } => {
431 Some(trait_) 431 trait_
432 } 432 }
433 _ => None, 433 _ => return false,
434 }; 434 };
435 435
436 let krate = self.resolver.krate(); 436 let krate = match self.resolver.krate() {
437 if let Some(krate) = krate { 437 Some(krate) => krate,
438 if let Some(trait_) = std_future_trait { 438 _ => return false,
439 let canonical_ty = crate::ty::Canonical { value: ty, num_vars: 0 }; 439 };
440 return implements_trait(&canonical_ty, db, &self.resolver, krate, trait_);
441 }
442 }
443 440
444 false 441 let canonical_ty = crate::ty::Canonical { value: ty, num_vars: 0 };
442 return implements_trait(&canonical_ty, db, &self.resolver, krate, std_future_trait);
445 } 443 }
446 444
447 #[cfg(test)] 445 #[cfg(test)]