mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Use a constructor function for Static lifetimes
This commit is contained in:
parent
b98c681cb7
commit
08dc69599e
6 changed files with 37 additions and 49 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue