Skip to content

Commit e590025

Browse files
committed
item.name -> item.ident.name
1 parent ece8b8e commit e590025

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

clippy_lints/src/attrs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
237237

238238
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
239239
if is_relevant_item(cx.tcx, item) {
240-
check_attrs(cx, item.span, item.name, &item.attrs)
240+
check_attrs(cx, item.span, item.ident.name, &item.attrs)
241241
}
242242
match item.node {
243243
ItemKind::ExternCrate(..) | ItemKind::Use(..) => {

clippy_lints/src/len_zero.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item, trait_items
176176
visited_trait.span,
177177
&format!(
178178
"trait `{}` has a `len` method but no (possibly inherited) `is_empty` method",
179-
visited_trait.name
179+
visited_trait.ident.name
180180
),
181181
);
182182
}

clippy_lints/src/missing_doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
141141
hir::ItemKind::Enum(..) => "an enum",
142142
hir::ItemKind::Fn(..) => {
143143
// ignore main()
144-
if it.name == "main" {
144+
if it.ident.name == "main" {
145145
let def_id = cx.tcx.hir().local_def_id(it.id);
146146
let def_key = cx.tcx.hir().def_key(def_id);
147147
if def_key.parent == Some(hir::def_id::CRATE_DEF_INDEX) {

clippy_lints/src/utils/inspector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ fn print_expr(cx: &LateContext<'_, '_>, expr: &hir::Expr, indent: usize) {
355355

356356
fn print_item(cx: &LateContext<'_, '_>, item: &hir::Item) {
357357
let did = cx.tcx.hir().local_def_id(item.id);
358-
println!("item `{}`", item.name);
358+
println!("item `{}`", item.ident.name);
359359
match item.vis.node {
360360
hir::VisibilityKind::Public => println!("public"),
361361
hir::VisibilityKind::Crate(_) => println!("visible crate wide"),

clippy_lints/src/utils/internal_lints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LintWithoutLintPass {
154154
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
155155
if let hir::ItemKind::Static(ref ty, MutImmutable, _) = item.node {
156156
if is_lint_ref_type(cx, ty) {
157-
self.declared_lints.insert(item.name, item.span);
157+
self.declared_lints.insert(item.ident.name, item.span);
158158
}
159159
} else if let hir::ItemKind::Impl(.., Some(ref trait_ref), _, ref impl_item_refs) = item.node {
160160
if_chain! {

clippy_lints/src/utils/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ pub fn method_chain_args<'a>(expr: &'a Expr, methods: &[&str]) -> Option<Vec<&'a
334334
pub fn get_item_name(cx: &LateContext<'_, '_>, expr: &Expr) -> Option<Name> {
335335
let parent_id = cx.tcx.hir().get_parent(expr.id);
336336
match cx.tcx.hir().find(parent_id) {
337-
Some(Node::Item(&Item { ref name, .. })) => Some(*name),
337+
Some(Node::Item(&Item { ref ident, .. })) => Some(ident.name),
338338
Some(Node::TraitItem(&TraitItem { ident, .. })) | Some(Node::ImplItem(&ImplItem { ident, .. })) => {
339339
Some(ident.name)
340340
},

0 commit comments

Comments
 (0)