mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 15:56:09 +03:00
save-analysis: merge StructRef and TypeRef
This commit is contained in:
@@ -249,7 +249,7 @@ fn lookup_def_kind(&self, ref_id: NodeId, span: Span) -> Option<recorder::Row> {
|
||||
match def {
|
||||
def::DefMod(_) |
|
||||
def::DefForeignMod(_) => Some(recorder::ModRef),
|
||||
def::DefStruct(_) => Some(recorder::StructRef),
|
||||
def::DefStruct(_) => Some(recorder::TypeRef),
|
||||
def::DefTy(..) |
|
||||
def::DefAssociatedTy(..) |
|
||||
def::DefTrait(_) => Some(recorder::TypeRef),
|
||||
@@ -785,7 +785,7 @@ fn process_path(&mut self,
|
||||
sub_span,
|
||||
def.def_id(),
|
||||
self.cur_scope),
|
||||
def::DefStruct(def_id) => self.fmt.ref_str(recorder::StructRef,
|
||||
def::DefStruct(def_id) => self.fmt.ref_str(recorder::TypeRef,
|
||||
span,
|
||||
sub_span,
|
||||
def_id,
|
||||
@@ -886,7 +886,7 @@ fn process_struct_lit(&mut self,
|
||||
let struct_def = match *ty {
|
||||
ty::TyStruct(def_id, _) => {
|
||||
let sub_span = self.span.span_for_last_ident(path.span);
|
||||
self.fmt.ref_str(recorder::StructRef,
|
||||
self.fmt.ref_str(recorder::TypeRef,
|
||||
path.span,
|
||||
sub_span,
|
||||
def_id,
|
||||
@@ -918,7 +918,7 @@ fn process_struct_lit(&mut self,
|
||||
None => {}
|
||||
}
|
||||
|
||||
self.visit_expr(&*field.expr)
|
||||
self.visit_expr(&field.expr)
|
||||
}
|
||||
visit::walk_expr_opt(self, base)
|
||||
}
|
||||
|
||||
@@ -89,7 +89,6 @@ pub enum Row {
|
||||
ModRef,
|
||||
VarRef,
|
||||
TypeRef,
|
||||
StructRef,
|
||||
FnRef,
|
||||
}
|
||||
|
||||
@@ -150,9 +149,6 @@ fn lookup_row(r: Row) -> (&'static str, Vec<&'static str>, bool, bool) {
|
||||
TypeRef => ("type_ref",
|
||||
vec!("refid","refidcrate","qualname","scopeid"),
|
||||
true, true),
|
||||
StructRef => ("struct_ref",
|
||||
vec!("refid","refidcrate","qualname","scopeid"),
|
||||
true, true),
|
||||
FnRef => ("fn_ref", vec!("refid","refidcrate","qualname","scopeid"), true, true)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user