mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 13:05:18 +03:00
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.
This commit is contained in:
@@ -53,7 +53,7 @@ fn is_impl_not_trait_with_bool_out<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -
|
||||
.not_trait()
|
||||
.filter(|trait_id| implements_trait(cx, ty, *trait_id, &[]))
|
||||
.and_then(|trait_id| {
|
||||
cx.tcx.associated_items(trait_id).find_by_name_and_kind(
|
||||
cx.tcx.associated_items(trait_id).find_by_ident_and_kind(
|
||||
cx.tcx,
|
||||
Ident::from_str("Output"),
|
||||
ty::AssocKind::Type,
|
||||
|
||||
@@ -22,8 +22,8 @@ pub(super) fn check_impl_item(cx: &LateContext<'_>, item: &ImplItem<'_>, ignored
|
||||
&& let Some(did) = trait_item_def_id_of_impl(items, item.owner_id)
|
||||
&& !is_from_ignored_trait(trait_ref, ignored_traits)
|
||||
{
|
||||
let mut param_idents_iter = cx.tcx.hir_body_param_names(body_id);
|
||||
let mut default_param_idents_iter = cx.tcx.fn_arg_names(did).iter().copied();
|
||||
let mut param_idents_iter = cx.tcx.hir_body_param_idents(body_id);
|
||||
let mut default_param_idents_iter = cx.tcx.fn_arg_idents(did).iter().copied();
|
||||
|
||||
let renames = RenamedFnArgs::new(&mut default_param_idents_iter, &mut param_idents_iter);
|
||||
if !renames.0.is_empty() {
|
||||
|
||||
@@ -238,7 +238,7 @@ fn is_contains_sig(cx: &LateContext<'_>, call_id: HirId, iter_expr: &Expr<'_>) -
|
||||
.instantiate_bound_regions_with_erased(sig.rebind(search_ty))
|
||||
.kind()
|
||||
&& let Some(iter_trait) = cx.tcx.get_diagnostic_item(sym::Iterator)
|
||||
&& let Some(iter_item) = cx.tcx.associated_items(iter_trait).find_by_name_and_kind(
|
||||
&& let Some(iter_item) = cx.tcx.associated_items(iter_trait).find_by_ident_and_kind(
|
||||
cx.tcx,
|
||||
Ident::with_dummy_span(sym::Item),
|
||||
AssocKind::Type,
|
||||
|
||||
@@ -1109,7 +1109,7 @@ fn helper<'tcx>(
|
||||
assoc_ty: Symbol,
|
||||
args: GenericArgsRef<'tcx>,
|
||||
) -> Option<AliasTy<'tcx>> {
|
||||
let Some(assoc_item) = tcx.associated_items(container_id).find_by_name_and_kind(
|
||||
let Some(assoc_item) = tcx.associated_items(container_id).find_by_ident_and_kind(
|
||||
tcx,
|
||||
Ident::with_dummy_span(assoc_ty),
|
||||
AssocKind::Type,
|
||||
|
||||
Reference in New Issue
Block a user