mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
modify insert_type_vars
for lifetimes
This commit is contained in:
parent
13301e7a1a
commit
b357bcab2b
5 changed files with 73 additions and 14 deletions
|
@ -42,7 +42,7 @@ use hir_def::{
|
|||
layout::Integer,
|
||||
path::{ModPath, Path},
|
||||
resolver::{HasResolver, ResolveValueResult, Resolver, TypeNs, ValueNs},
|
||||
type_ref::TypeRef,
|
||||
type_ref::{LifetimeRef, TypeRef},
|
||||
AdtId, AssocItemId, DefWithBodyId, FieldId, FunctionId, ItemContainerId, Lookup, TraitId,
|
||||
TupleFieldId, TupleId, TypeAliasId, VariantId,
|
||||
};
|
||||
|
@ -1037,6 +1037,12 @@ impl<'a> InferenceContext<'a> {
|
|||
self.result.standard_types.unknown.clone()
|
||||
}
|
||||
|
||||
fn make_lifetime(&mut self, lifetime_ref: &LifetimeRef) -> Lifetime {
|
||||
let ctx = crate::lower::TyLoweringContext::new(self.db, &self.resolver, self.owner.into());
|
||||
let lt = ctx.lower_lifetime(lifetime_ref);
|
||||
self.insert_type_vars(lt)
|
||||
}
|
||||
|
||||
/// Replaces `Ty::Error` by a new type var, so we can maybe still infer it.
|
||||
fn insert_type_vars_shallow(&mut self, ty: Ty) -> Ty {
|
||||
self.table.insert_type_vars_shallow(ty)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue