From 08dc69599efb4961319c0118b789d3abb264b7fa Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 6 Apr 2021 10:50:55 +0200 Subject: Use a constructor function for Static lifetimes --- crates/hir_ty/src/method_resolution.rs | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'crates/hir_ty/src/method_resolution.rs') 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::{ db::HirDatabase, from_foreign_def_id, primitive::{self, FloatTy, IntTy, UintTy}, + static_lifetime, utils::all_super_traits, AdtId, Canonical, CanonicalVarKinds, DebruijnIndex, FnPointer, FnSig, ForeignDefId, - InEnvironment, Interner, LifetimeData, Scalar, Substitution, TraitEnvironment, Ty, TyBuilder, - TyKind, TypeWalk, + InEnvironment, Interner, Scalar, Substitution, TraitEnvironment, Ty, TyBuilder, TyKind, + TypeWalk, }; /// This is used as a key for indexing impls. @@ -453,12 +454,8 @@ fn iterate_method_candidates_with_autoref( } let refed = Canonical { binders: deref_chain[0].binders.clone(), - value: TyKind::Ref( - Mutability::Not, - LifetimeData::Static.intern(&Interner), - deref_chain[0].value.clone(), - ) - .intern(&Interner), + value: TyKind::Ref(Mutability::Not, static_lifetime(), deref_chain[0].value.clone()) + .intern(&Interner), }; if iterate_method_candidates_by_receiver( &refed, @@ -475,12 +472,8 @@ fn iterate_method_candidates_with_autoref( } let ref_muted = Canonical { binders: deref_chain[0].binders.clone(), - value: TyKind::Ref( - Mutability::Mut, - LifetimeData::Static.intern(&Interner), - deref_chain[0].value.clone(), - ) - .intern(&Interner), + value: TyKind::Ref(Mutability::Mut, static_lifetime(), deref_chain[0].value.clone()) + .intern(&Interner), }; if iterate_method_candidates_by_receiver( &ref_muted, -- cgit v1.2.3