Rollup merge of #139510 - nnethercote:name-to-ident, r=fee1-dead
Rename some `name` variables as `ident`. It bugs me when variables of type `Ident` are called `name`. It leads to silly things like `name.name`. `Ident` variables should be called `ident`, and `name` should be used for variables of type `Symbol`. This commit improves things by by doing `s/name/ident/` on a bunch of `Ident` variables. Not all of them, but a decent chunk. r? `@fee1-dead`
This commit is contained in:
commit
79f357e63d
52 changed files with 241 additions and 229 deletions
|
@ -2550,7 +2550,11 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
.iter()
|
||||
.filter_map(|item| {
|
||||
let parent_module = self.opt_local_def_id(item.parent_module)?.to_def_id();
|
||||
Some(StrippedCfgItem { parent_module, name: item.name, cfg: item.cfg.clone() })
|
||||
Some(StrippedCfgItem {
|
||||
parent_module,
|
||||
ident: item.ident,
|
||||
cfg: item.cfg.clone(),
|
||||
})
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
local_items.as_slice()
|
||||
|
@ -2558,12 +2562,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
self.tcx.stripped_cfg_items(module.krate)
|
||||
};
|
||||
|
||||
for &StrippedCfgItem { parent_module, name, ref cfg } in symbols {
|
||||
if parent_module != module || name.name != *segment {
|
||||
for &StrippedCfgItem { parent_module, ident, ref cfg } in symbols {
|
||||
if parent_module != module || ident.name != *segment {
|
||||
continue;
|
||||
}
|
||||
|
||||
let note = errors::FoundItemConfigureOut { span: name.span };
|
||||
let note = errors::FoundItemConfigureOut { span: ident.span };
|
||||
err.subdiagnostic(note);
|
||||
|
||||
if let MetaItemKind::List(nested) = &cfg.kind
|
||||
|
|
|
@ -2238,7 +2238,7 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
|
|||
.get(&def_id)
|
||||
.is_some_and(|sig| sig.has_self),
|
||||
None => {
|
||||
self.r.tcx.fn_arg_names(def_id).first().is_some_and(|&ident| {
|
||||
self.r.tcx.fn_arg_idents(def_id).first().is_some_and(|&ident| {
|
||||
matches!(ident, Some(Ident { name: kw::SelfLower, .. }))
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1648,7 +1648,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
.filter_map(|item| {
|
||||
let parent_module =
|
||||
self.node_id_to_def_id.get(&item.parent_module)?.key().to_def_id();
|
||||
Some(StrippedCfgItem { parent_module, name: item.name, cfg: item.cfg })
|
||||
Some(StrippedCfgItem { parent_module, ident: item.ident, cfg: item.cfg })
|
||||
})
|
||||
.collect(),
|
||||
);
|
||||
|
|
|
@ -469,8 +469,8 @@ impl<'ra, 'tcx> ResolverExpand for Resolver<'ra, 'tcx> {
|
|||
self.proc_macros.push(id)
|
||||
}
|
||||
|
||||
fn append_stripped_cfg_item(&mut self, parent_node: NodeId, name: Ident, cfg: ast::MetaItem) {
|
||||
self.stripped_cfg_items.push(StrippedCfgItem { parent_module: parent_node, name, cfg });
|
||||
fn append_stripped_cfg_item(&mut self, parent_node: NodeId, ident: Ident, cfg: ast::MetaItem) {
|
||||
self.stripped_cfg_items.push(StrippedCfgItem { parent_module: parent_node, ident, cfg });
|
||||
}
|
||||
|
||||
fn registered_tools(&self) -> &RegisteredTools {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue