mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Remove previously added parameter names from the function data
This commit is contained in:
parent
b42562b5de
commit
cfbee8d3a3
3 changed files with 0 additions and 18 deletions
|
@ -19,7 +19,6 @@ use crate::{
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct FunctionData {
|
pub struct FunctionData {
|
||||||
pub name: Name,
|
pub name: Name,
|
||||||
pub param_names: Vec<Option<Name>>,
|
|
||||||
pub params: Vec<TypeRef>,
|
pub params: Vec<TypeRef>,
|
||||||
pub ret_type: TypeRef,
|
pub ret_type: TypeRef,
|
||||||
pub attrs: Attrs,
|
pub attrs: Attrs,
|
||||||
|
@ -40,7 +39,6 @@ impl FunctionData {
|
||||||
|
|
||||||
Arc::new(FunctionData {
|
Arc::new(FunctionData {
|
||||||
name: func.name.clone(),
|
name: func.name.clone(),
|
||||||
param_names: func.param_names.to_vec(),
|
|
||||||
params: func.params.to_vec(),
|
params: func.params.to_vec(),
|
||||||
ret_type: func.ret_type.clone(),
|
ret_type: func.ret_type.clone(),
|
||||||
attrs: item_tree.attrs(ModItem::from(loc.id.value).into()).clone(),
|
attrs: item_tree.attrs(ModItem::from(loc.id.value).into()).clone(),
|
||||||
|
|
|
@ -507,8 +507,6 @@ pub struct Function {
|
||||||
pub has_self_param: bool,
|
pub has_self_param: bool,
|
||||||
pub has_body: bool,
|
pub has_body: bool,
|
||||||
pub is_unsafe: bool,
|
pub is_unsafe: bool,
|
||||||
/// List of function parameters names. Does not include `self`.
|
|
||||||
pub param_names: Box<[Option<Name>]>,
|
|
||||||
pub params: Box<[TypeRef]>,
|
pub params: Box<[TypeRef]>,
|
||||||
pub is_varargs: bool,
|
pub is_varargs: bool,
|
||||||
pub ret_type: TypeRef,
|
pub ret_type: TypeRef,
|
||||||
|
|
|
@ -283,7 +283,6 @@ impl Ctx {
|
||||||
let name = func.name()?.as_name();
|
let name = func.name()?.as_name();
|
||||||
|
|
||||||
let mut params = Vec::new();
|
let mut params = Vec::new();
|
||||||
let mut param_names = Vec::new();
|
|
||||||
let mut has_self_param = false;
|
let mut has_self_param = false;
|
||||||
if let Some(param_list) = func.param_list() {
|
if let Some(param_list) = func.param_list() {
|
||||||
if let Some(self_param) = param_list.self_param() {
|
if let Some(self_param) = param_list.self_param() {
|
||||||
|
@ -306,18 +305,6 @@ impl Ctx {
|
||||||
has_self_param = true;
|
has_self_param = true;
|
||||||
}
|
}
|
||||||
for param in param_list.params() {
|
for param in param_list.params() {
|
||||||
let param_name = param
|
|
||||||
.pat()
|
|
||||||
.map(|name| {
|
|
||||||
if let ast::Pat::IdentPat(ident) = name {
|
|
||||||
Some(ident.name()?.as_name())
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.flatten();
|
|
||||||
param_names.push(param_name);
|
|
||||||
|
|
||||||
let type_ref = TypeRef::from_ast_opt(&self.body_ctx, param.ty());
|
let type_ref = TypeRef::from_ast_opt(&self.body_ctx, param.ty());
|
||||||
params.push(type_ref);
|
params.push(type_ref);
|
||||||
}
|
}
|
||||||
|
@ -354,7 +341,6 @@ impl Ctx {
|
||||||
has_body,
|
has_body,
|
||||||
is_unsafe: func.unsafe_token().is_some(),
|
is_unsafe: func.unsafe_token().is_some(),
|
||||||
params: params.into_boxed_slice(),
|
params: params.into_boxed_slice(),
|
||||||
param_names: param_names.into_boxed_slice(),
|
|
||||||
is_varargs,
|
is_varargs,
|
||||||
ret_type,
|
ret_type,
|
||||||
ast_id,
|
ast_id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue