Skip to content

Commit cfbee8d

Browse files
committed
Remove previously added parameter names from the function data
1 parent b42562b commit cfbee8d

File tree

3 files changed

+0
-18
lines changed

3 files changed

+0
-18
lines changed

crates/hir_def/src/data.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use crate::{
1919
#[derive(Debug, Clone, PartialEq, Eq)]
2020
pub struct FunctionData {
2121
pub name: Name,
22-
pub param_names: Vec<Option<Name>>,
2322
pub params: Vec<TypeRef>,
2423
pub ret_type: TypeRef,
2524
pub attrs: Attrs,
@@ -40,7 +39,6 @@ impl FunctionData {
4039

4140
Arc::new(FunctionData {
4241
name: func.name.clone(),
43-
param_names: func.param_names.to_vec(),
4442
params: func.params.to_vec(),
4543
ret_type: func.ret_type.clone(),
4644
attrs: item_tree.attrs(ModItem::from(loc.id.value).into()).clone(),

crates/hir_def/src/item_tree.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,6 @@ pub struct Function {
507507
pub has_self_param: bool,
508508
pub has_body: bool,
509509
pub is_unsafe: bool,
510-
/// List of function parameters names. Does not include `self`.
511-
pub param_names: Box<[Option<Name>]>,
512510
pub params: Box<[TypeRef]>,
513511
pub is_varargs: bool,
514512
pub ret_type: TypeRef,

crates/hir_def/src/item_tree/lower.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ impl Ctx {
283283
let name = func.name()?.as_name();
284284

285285
let mut params = Vec::new();
286-
let mut param_names = Vec::new();
287286
let mut has_self_param = false;
288287
if let Some(param_list) = func.param_list() {
289288
if let Some(self_param) = param_list.self_param() {
@@ -306,18 +305,6 @@ impl Ctx {
306305
has_self_param = true;
307306
}
308307
for param in param_list.params() {
309-
let param_name = param
310-
.pat()
311-
.map(|name| {
312-
if let ast::Pat::IdentPat(ident) = name {
313-
Some(ident.name()?.as_name())
314-
} else {
315-
None
316-
}
317-
})
318-
.flatten();
319-
param_names.push(param_name);
320-
321308
let type_ref = TypeRef::from_ast_opt(&self.body_ctx, param.ty());
322309
params.push(type_ref);
323310
}
@@ -354,7 +341,6 @@ impl Ctx {
354341
has_body,
355342
is_unsafe: func.unsafe_token().is_some(),
356343
params: params.into_boxed_slice(),
357-
param_names: param_names.into_boxed_slice(),
358344
is_varargs,
359345
ret_type,
360346
ast_id,

0 commit comments

Comments
 (0)