Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyup

This commit is contained in:
flip1995
2022-01-13 13:18:19 +01:00
parent dda2aef64f
commit fb0142ae41
223 changed files with 3261 additions and 1687 deletions
+2 -3
View File
@@ -53,13 +53,12 @@ fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
}
}
fn is_struct_with_trailing_zero_sized_array(cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) -> bool {
fn is_struct_with_trailing_zero_sized_array(cx: &LateContext<'_>, item: &Item<'_>) -> bool {
if_chain! {
// First check if last field is an array
if let ItemKind::Struct(data, _) = &item.kind;
if let Some(last_field) = data.fields().last();
if let rustc_hir::TyKind::Array(_, length) = last_field.ty.kind;
if let rustc_hir::ArrayLen::Body(length) = length;
if let rustc_hir::TyKind::Array(_, rustc_hir::ArrayLen::Body(length)) = last_field.ty.kind;
// Then check if that that array zero-sized
let length_ldid = cx.tcx.hir().local_def_id(length.hir_id);