Skip to content

Commit 19e305b

Browse files
authored
Rustup (#13970)
r? @ghost changelog: none
2 parents 894e87c + 663892b commit 19e305b

36 files changed

+86
-46
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy"
33
# begin autogenerated version
4-
version = "0.1.85"
4+
version = "0.1.86"
55
# end autogenerated version
66
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
77
repository = "https://github.com/rust-lang/rust-clippy"

clippy_config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_config"
33
# begin autogenerated version
4-
version = "0.1.85"
4+
version = "0.1.86"
55
# end autogenerated version
66
edition = "2021"
77
publish = false

clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_lints"
33
# begin autogenerated version
4-
version = "0.1.85"
4+
version = "0.1.86"
55
# end autogenerated version
66
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
77
repository = "https://github.com/rust-lang/rust-clippy"

clippy_lints/src/arbitrary_source_item_ordering.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ fn convert_module_item_kind(value: &ItemKind<'_>) -> SourceItemOrderingModuleIte
464464
ItemKind::Use(..) => Use,
465465
ItemKind::Static(..) => Static,
466466
ItemKind::Const(..) => Const,
467-
ItemKind::Fn(..) => Fn,
467+
ItemKind::Fn { .. } => Fn,
468468
ItemKind::Macro(..) => Macro,
469469
ItemKind::Mod(..) => Mod,
470470
ItemKind::ForeignMod { .. } => ForeignMod,

clippy_lints/src/attrs/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub(super) fn is_lint_level(symbol: Symbol, attr_id: AttrId) -> bool {
2121
}
2222

2323
pub(super) fn is_relevant_item(cx: &LateContext<'_>, item: &Item<'_>) -> bool {
24-
if let ItemKind::Fn(_, _, eid) = item.kind {
24+
if let ItemKind::Fn { body: eid, .. } = item.kind {
2525
is_relevant_expr(cx, cx.tcx.typeck_body(eid), cx.tcx.hir().body(eid).value)
2626
} else {
2727
true

clippy_lints/src/doc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ impl<'tcx> LateLintPass<'tcx> for Documentation {
639639
self.check_private_items,
640640
);
641641
match item.kind {
642-
ItemKind::Fn(sig, _, body_id) => {
642+
ItemKind::Fn { sig, body: body_id, .. } => {
643643
if !(is_entrypoint_fn(cx, item.owner_id.to_def_id())
644644
|| in_external_macro(cx.tcx.sess, item.span))
645645
{

clippy_lints/src/doc/too_long_first_doc_paragraph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub(super) fn check(
2525
// page. So associated items or impl blocks are not part of this list.
2626
ItemKind::Static(..)
2727
| ItemKind::Const(..)
28-
| ItemKind::Fn(..)
28+
| ItemKind::Fn { .. }
2929
| ItemKind::Macro(..)
3030
| ItemKind::Mod(..)
3131
| ItemKind::TyAlias(..)

clippy_lints/src/equatable_if_let.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn unary_pattern(pat: &Pat<'_>) -> bool {
5555
| PatKind::Err(_) => false,
5656
PatKind::Struct(_, a, etc) => !etc && a.iter().all(|x| unary_pattern(x.pat)),
5757
PatKind::Tuple(a, etc) | PatKind::TupleStruct(_, a, etc) => etc.as_opt_usize().is_none() && array_rec(a),
58-
PatKind::Ref(x, _) | PatKind::Box(x) | PatKind::Deref(x) => unary_pattern(x),
58+
PatKind::Ref(x, _) | PatKind::Box(x) | PatKind::Deref(x) | PatKind::Guard(x, _) => unary_pattern(x),
5959
PatKind::Path(_) | PatKind::Lit(_) => true,
6060
}
6161
}

clippy_lints/src/exit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl<'tcx> LateLintPass<'tcx> for Exit {
4848
&& let Some(def_id) = cx.qpath_res(path, path_expr.hir_id).opt_def_id()
4949
&& cx.tcx.is_diagnostic_item(sym::process_exit, def_id)
5050
&& let parent = cx.tcx.hir().get_parent_item(e.hir_id)
51-
&& let OwnerNode::Item(Item{kind: ItemKind::Fn(..), ..}) = cx.tcx.hir_owner_node(parent)
51+
&& let OwnerNode::Item(Item{kind: ItemKind::Fn{ .. }, ..}) = cx.tcx.hir_owner_node(parent)
5252
// If the next item up is a function we check if it is an entry point
5353
// and only then emit a linter warning
5454
&& !is_entrypoint_fn(cx, parent.to_def_id())

clippy_lints/src/extra_unused_type_parameters.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,11 @@ fn is_empty_body(cx: &LateContext<'_>, body: BodyId) -> bool {
253253

254254
impl<'tcx> LateLintPass<'tcx> for ExtraUnusedTypeParameters {
255255
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
256-
if let ItemKind::Fn(_, generics, body_id) = item.kind
256+
if let ItemKind::Fn {
257+
generics,
258+
body: body_id,
259+
..
260+
} = item.kind
257261
&& !generics.params.is_empty()
258262
&& !is_empty_body(cx, body_id)
259263
&& (!self.avoid_breaking_exported_api || !cx.effective_visibilities.is_exported(item.owner_id.def_id))

0 commit comments

Comments
 (0)