aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/method_resolution.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-13 08:18:49 +0100
committerGitHub <[email protected]>2021-06-13 08:18:49 +0100
commitadbee621a75f47e0da4f30d7205dfce009138865 (patch)
treeed8dcbba37de566f00d119817e141bb8293ce164 /crates/hir_ty/src/method_resolution.rs
parentf107b0f1e223dba33cb9850ce44bcbb4345eef52 (diff)
parent5ac6804bb3a07b959e8c2c3534255a8d6bb4948c (diff)
Merge #9242
9242: Clippy r=matklad a=Maan2003 Best viewed commit wise Co-authored-by: Maan2003 <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/method_resolution.rs')
-rw-r--r--crates/hir_ty/src/method_resolution.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs
index a23527f7d..f3d390961 100644
--- a/crates/hir_ty/src/method_resolution.rs
+++ b/crates/hir_ty/src/method_resolution.rs
@@ -60,7 +60,7 @@ impl TyFingerprint {
60 TyKind::Adt(AdtId(adt), _) => TyFingerprint::Adt(*adt), 60 TyKind::Adt(AdtId(adt), _) => TyFingerprint::Adt(*adt),
61 TyKind::Raw(mutability, ..) => TyFingerprint::RawPtr(*mutability), 61 TyKind::Raw(mutability, ..) => TyFingerprint::RawPtr(*mutability),
62 TyKind::Foreign(alias_id, ..) => TyFingerprint::ForeignType(*alias_id), 62 TyKind::Foreign(alias_id, ..) => TyFingerprint::ForeignType(*alias_id),
63 TyKind::Dyn(_) => ty.dyn_trait().map(|trait_| TyFingerprint::Dyn(trait_))?, 63 TyKind::Dyn(_) => ty.dyn_trait().map(TyFingerprint::Dyn)?,
64 _ => return None, 64 _ => return None,
65 }; 65 };
66 Some(fp) 66 Some(fp)
@@ -77,7 +77,7 @@ impl TyFingerprint {
77 TyKind::Adt(AdtId(adt), _) => TyFingerprint::Adt(*adt), 77 TyKind::Adt(AdtId(adt), _) => TyFingerprint::Adt(*adt),
78 TyKind::Raw(mutability, ..) => TyFingerprint::RawPtr(*mutability), 78 TyKind::Raw(mutability, ..) => TyFingerprint::RawPtr(*mutability),
79 TyKind::Foreign(alias_id, ..) => TyFingerprint::ForeignType(*alias_id), 79 TyKind::Foreign(alias_id, ..) => TyFingerprint::ForeignType(*alias_id),
80 TyKind::Dyn(_) => ty.dyn_trait().map(|trait_| TyFingerprint::Dyn(trait_))?, 80 TyKind::Dyn(_) => ty.dyn_trait().map(TyFingerprint::Dyn)?,
81 TyKind::Ref(_, _, ty) => return TyFingerprint::for_trait_impl(ty), 81 TyKind::Ref(_, _, ty) => return TyFingerprint::for_trait_impl(ty),
82 TyKind::Tuple(_, subst) => { 82 TyKind::Tuple(_, subst) => {
83 let first_ty = subst.interned().get(0).map(|arg| arg.assert_ty_ref(&Interner)); 83 let first_ty = subst.interned().get(0).map(|arg| arg.assert_ty_ref(&Interner));
@@ -372,7 +372,7 @@ pub(crate) fn lookup_method(
372 db, 372 db,
373 env, 373 env,
374 krate, 374 krate,
375 &traits_in_scope, 375 traits_in_scope,
376 visible_from_module, 376 visible_from_module,
377 Some(name), 377 Some(name),
378 LookupMode::MethodCall, 378 LookupMode::MethodCall,
@@ -484,7 +484,7 @@ fn iterate_method_candidates_impl(
484 LookupMode::Path => { 484 LookupMode::Path => {
485 // No autoderef for path lookups 485 // No autoderef for path lookups
486 iterate_method_candidates_for_self_ty( 486 iterate_method_candidates_for_self_ty(
487 &ty, 487 ty,
488 db, 488 db,
489 env, 489 env,
490 krate, 490 krate,
@@ -513,7 +513,7 @@ fn iterate_method_candidates_with_autoref(
513 db, 513 db,
514 env.clone(), 514 env.clone(),
515 krate, 515 krate,
516 &traits_in_scope, 516 traits_in_scope,
517 visible_from_module, 517 visible_from_module,
518 name, 518 name,
519 &mut callback, 519 &mut callback,
@@ -531,7 +531,7 @@ fn iterate_method_candidates_with_autoref(
531 db, 531 db,
532 env.clone(), 532 env.clone(),
533 krate, 533 krate,
534 &traits_in_scope, 534 traits_in_scope,
535 visible_from_module, 535 visible_from_module,
536 name, 536 name,
537 &mut callback, 537 &mut callback,
@@ -549,7 +549,7 @@ fn iterate_method_candidates_with_autoref(
549 db, 549 db,
550 env, 550 env,
551 krate, 551 krate,
552 &traits_in_scope, 552 traits_in_scope,
553 visible_from_module, 553 visible_from_module,
554 name, 554 name,
555 &mut callback, 555 &mut callback,
@@ -593,7 +593,7 @@ fn iterate_method_candidates_by_receiver(
593 db, 593 db,
594 env.clone(), 594 env.clone(),
595 krate, 595 krate,
596 &traits_in_scope, 596 traits_in_scope,
597 name, 597 name,
598 Some(receiver_ty), 598 Some(receiver_ty),
599 &mut callback, 599 &mut callback,
@@ -870,7 +870,7 @@ fn transform_receiver_ty(
870 .fill_with_unknown() 870 .fill_with_unknown()
871 .build(), 871 .build(),
872 AssocContainerId::ImplId(impl_id) => { 872 AssocContainerId::ImplId(impl_id) => {
873 let impl_substs = inherent_impl_substs(db, env, impl_id, &self_ty)?; 873 let impl_substs = inherent_impl_substs(db, env, impl_id, self_ty)?;
874 TyBuilder::subst_for_def(db, function_id) 874 TyBuilder::subst_for_def(db, function_id)
875 .use_parent_substs(&impl_substs) 875 .use_parent_substs(&impl_substs)
876 .fill_with_unknown() 876 .fill_with_unknown()