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