Skip to content

Commit d475842

Browse files
committed
1 parent 4192dbe commit d475842

File tree

9 files changed

+22
-22
lines changed

9 files changed

+22
-22
lines changed

clippy_lints/src/attrs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ fn check_clippy_lint_names(cx: &LateContext<'_, '_>, items: &[NestedMetaItem]) {
355355
}
356356

357357
fn is_relevant_item(cx: &LateContext<'_, '_>, item: &Item) -> bool {
358-
if let ItemKind::Fn(_, _, _, eid) = item.kind {
358+
if let ItemKind::Fn(_, _, eid) = item.kind {
359359
is_relevant_expr(cx, cx.tcx.body_tables(eid), &cx.tcx.hir().body(eid).value)
360360
} else {
361361
true

clippy_lints/src/doc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DocMarkdown {
126126
}
127127
// no safety header
128128
match item.kind {
129-
hir::ItemKind::Fn(_, ref header, ..) => {
130-
if cx.access_levels.is_exported(item.hir_id) && header.unsafety == hir::Unsafety::Unsafe {
129+
hir::ItemKind::Fn(ref sig, ..) => {
130+
if cx.access_levels.is_exported(item.hir_id) && sig.header.unsafety == hir::Unsafety::Unsafe {
131131
span_lint(
132132
cx,
133133
MISSING_SAFETY_DOC,

clippy_lints/src/functions.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
208208
match kind {
209209
hir::intravisit::FnKind::Method(
210210
_,
211-
&hir::MethodSig {
211+
&hir::FnSig {
212212
header: hir::FnHeader { abi: Abi::Rust, .. },
213213
..
214214
},
@@ -228,20 +228,20 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
228228

229229
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
230230
let attr = must_use_attr(&item.attrs);
231-
if let hir::ItemKind::Fn(ref decl, ref _header, ref _generics, ref body_id) = item.kind {
231+
if let hir::ItemKind::Fn(ref sig, ref _generics, ref body_id) = item.kind {
232232
if let Some(attr) = attr {
233-
let fn_header_span = item.span.with_hi(decl.output.span().hi());
234-
check_needless_must_use(cx, decl, item.hir_id, item.span, fn_header_span, attr);
233+
let fn_header_span = item.span.with_hi(sig.decl.output.span().hi());
234+
check_needless_must_use(cx, &sig.decl, item.hir_id, item.span, fn_header_span, attr);
235235
return;
236236
}
237237
if cx.access_levels.is_exported(item.hir_id) && !is_proc_macro(&item.attrs) {
238238
check_must_use_candidate(
239239
cx,
240-
decl,
240+
&sig.decl,
241241
cx.tcx.hir().body(*body_id),
242242
item.span,
243243
item.hir_id,
244-
item.span.with_hi(decl.output.span().hi()),
244+
item.span.with_hi(sig.decl.output.span().hi()),
245245
"this function could have a `#[must_use]` attribute",
246246
);
247247
}

clippy_lints/src/lifetimes.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ declare_lint_pass!(Lifetimes => [NEEDLESS_LIFETIMES, EXTRA_UNUSED_LIFETIMES]);
5959

6060
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Lifetimes {
6161
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
62-
if let ItemKind::Fn(ref decl, _, ref generics, id) = item.kind {
63-
check_fn_inner(cx, decl, Some(id), generics, item.span, true);
62+
if let ItemKind::Fn(ref sig, ref generics, id) = item.kind {
63+
check_fn_inner(cx, &sig.decl, Some(id), generics, item.span, true);
6464
}
6565
}
6666

clippy_lints/src/non_expressive_names.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ impl<'a, 'tcx> Visitor<'tcx> for SimilarNamesLocalVisitor<'a, 'tcx> {
352352

353353
impl EarlyLintPass for NonExpressiveNames {
354354
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
355-
if let ItemKind::Fn(ref decl, _, _, ref blk) = item.kind {
356-
do_check(self, cx, &item.attrs, decl, blk);
355+
if let ItemKind::Fn(ref sig, _, ref blk) = item.kind {
356+
do_check(self, cx, &item.attrs, &sig.decl, blk);
357357
}
358358
}
359359

clippy_lints/src/ptr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ declare_lint_pass!(Ptr => [PTR_ARG, CMP_NULL, MUT_FROM_REF]);
101101

102102
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Ptr {
103103
fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
104-
if let ItemKind::Fn(ref decl, _, _, body_id) = item.kind {
105-
check_fn(cx, decl, item.hir_id, Some(body_id));
104+
if let ItemKind::Fn(ref sig, _, body_id) = item.kind {
105+
check_fn(cx, &sig.decl, item.hir_id, Some(body_id));
106106
}
107107
}
108108

clippy_lints/src/types.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeComplexity {
14081408
fn check_trait_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx TraitItem) {
14091409
match item.kind {
14101410
TraitItemKind::Const(ref ty, _) | TraitItemKind::Type(_, Some(ref ty)) => self.check_type(cx, ty),
1411-
TraitItemKind::Method(MethodSig { ref decl, .. }, TraitMethod::Required(_)) => self.check_fndecl(cx, decl),
1411+
TraitItemKind::Method(FnSig { ref decl, .. }, TraitMethod::Required(_)) => self.check_fndecl(cx, decl),
14121412
// methods with default impl are covered by check_fn
14131413
_ => (),
14141414
}
@@ -2118,10 +2118,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImplicitHasher {
21182118
);
21192119
}
21202120
},
2121-
ItemKind::Fn(ref decl, .., ref generics, body_id) => {
2121+
ItemKind::Fn(ref sig, ref generics, body_id) => {
21222122
let body = cx.tcx.hir().body(body_id);
21232123

2124-
for ty in &decl.inputs {
2124+
for ty in &sig.decl.inputs {
21252125
let mut vis = ImplicitHasherTypeVisitor::new(cx);
21262126
vis.visit_ty(ty);
21272127

clippy_lints/src/use_self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UseSelf {
193193
if let Some(impl_trait_ref) = impl_trait_ref {
194194
for impl_item_ref in refs {
195195
let impl_item = cx.tcx.hir().impl_item(impl_item_ref.id);
196-
if let ImplItemKind::Method(MethodSig{ decl: impl_decl, .. }, impl_body_id)
196+
if let ImplItemKind::Method(FnSig{ decl: impl_decl, .. }, impl_body_id)
197197
= &impl_item.kind {
198198
let item_type = cx.tcx.type_of(impl_def_id);
199199
check_trait_method_impl_decl(cx, item_type, impl_item, impl_decl, &impl_trait_ref);

clippy_lints/src/utils/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ pub fn in_constant(cx: &LateContext<'_, '_>, id: HirId) -> bool {
8787
..
8888
}) => true,
8989
Node::Item(&Item {
90-
kind: ItemKind::Fn(_, header, ..),
90+
kind: ItemKind::Fn(ref sig, ..),
9191
..
92-
}) => header.constness == Constness::Const,
92+
}) => sig.header.constness == Constness::Const,
9393
Node::ImplItem(&ImplItem {
9494
kind: ImplItemKind::Method(ref sig, _),
9595
..
@@ -635,7 +635,7 @@ pub fn get_enclosing_block<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, hir_id: HirId)
635635
match node {
636636
Node::Block(block) => Some(block),
637637
Node::Item(&Item {
638-
kind: ItemKind::Fn(_, _, _, eid),
638+
kind: ItemKind::Fn(_, _, eid),
639639
..
640640
})
641641
| Node::ImplItem(&ImplItem {

0 commit comments

Comments
 (0)