aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/method_resolution.rs
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-04-06 09:50:55 +0100
committerLukas Wirth <[email protected]>2021-04-06 09:50:55 +0100
commit08dc69599efb4961319c0118b789d3abb264b7fa (patch)
treef4951c835dd6f4840ae02ba5c06d5da44aedae94 /crates/hir_ty/src/method_resolution.rs
parentb98c681cb7ede9fd6a8683b1edd83a5b18502178 (diff)
Use a constructor function for Static lifetimes
Diffstat (limited to 'crates/hir_ty/src/method_resolution.rs')
-rw-r--r--crates/hir_ty/src/method_resolution.rs21
1 files changed, 7 insertions, 14 deletions
diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs
index 427844c12..436dea22b 100644
--- a/crates/hir_ty/src/method_resolution.rs
+++ b/crates/hir_ty/src/method_resolution.rs
@@ -19,10 +19,11 @@ use crate::{
19 db::HirDatabase, 19 db::HirDatabase,
20 from_foreign_def_id, 20 from_foreign_def_id,
21 primitive::{self, FloatTy, IntTy, UintTy}, 21 primitive::{self, FloatTy, IntTy, UintTy},
22 static_lifetime,
22 utils::all_super_traits, 23 utils::all_super_traits,
23 AdtId, Canonical, CanonicalVarKinds, DebruijnIndex, FnPointer, FnSig, ForeignDefId, 24 AdtId, Canonical, CanonicalVarKinds, DebruijnIndex, FnPointer, FnSig, ForeignDefId,
24 InEnvironment, Interner, LifetimeData, Scalar, Substitution, TraitEnvironment, Ty, TyBuilder, 25 InEnvironment, Interner, Scalar, Substitution, TraitEnvironment, Ty, TyBuilder, TyKind,
25 TyKind, TypeWalk, 26 TypeWalk,
26}; 27};
27 28
28/// This is used as a key for indexing impls. 29/// This is used as a key for indexing impls.
@@ -453,12 +454,8 @@ fn iterate_method_candidates_with_autoref(
453 } 454 }
454 let refed = Canonical { 455 let refed = Canonical {
455 binders: deref_chain[0].binders.clone(), 456 binders: deref_chain[0].binders.clone(),
456 value: TyKind::Ref( 457 value: TyKind::Ref(Mutability::Not, static_lifetime(), deref_chain[0].value.clone())
457 Mutability::Not, 458 .intern(&Interner),
458 LifetimeData::Static.intern(&Interner),
459 deref_chain[0].value.clone(),
460 )
461 .intern(&Interner),
462 }; 459 };
463 if iterate_method_candidates_by_receiver( 460 if iterate_method_candidates_by_receiver(
464 &refed, 461 &refed,
@@ -475,12 +472,8 @@ fn iterate_method_candidates_with_autoref(
475 } 472 }
476 let ref_muted = Canonical { 473 let ref_muted = Canonical {
477 binders: deref_chain[0].binders.clone(), 474 binders: deref_chain[0].binders.clone(),
478 value: TyKind::Ref( 475 value: TyKind::Ref(Mutability::Mut, static_lifetime(), deref_chain[0].value.clone())
479 Mutability::Mut, 476 .intern(&Interner),
480 LifetimeData::Static.intern(&Interner),
481 deref_chain[0].value.clone(),
482 )
483 .intern(&Interner),
484 }; 477 };
485 if iterate_method_candidates_by_receiver( 478 if iterate_method_candidates_by_receiver(
486 &ref_muted, 479 &ref_muted,