Auto merge of #16451 - Urhengulas:satisfy-clippy, r=Veykril

internal: Work through temporarily allowed clippy lints, part 2

Another follow-up to https://github.com/rust-lang/rust-analyzer/pull/16401.
This commit is contained in:
bors 2024-02-01 14:23:18 +00:00
commit 850ba2fb63
39 changed files with 136 additions and 149 deletions

View file

@ -84,8 +84,7 @@ impl TypeVisitor<Interner> for UninhabitedFrom<'_> {
Some(0) | None => CONTINUE_OPAQUELY_INHABITED,
Some(1..) => item_ty.super_visit_with(self, outer_binder),
},
TyKind::Ref(..) | _ => CONTINUE_OPAQUELY_INHABITED,
_ => CONTINUE_OPAQUELY_INHABITED,
};
self.recursive_ty.remove(ty);
self.max_depth += 1;

View file

@ -114,7 +114,7 @@ impl MirLowerCtx<'_> {
index: i as u32,
}))
}),
&mut cond_place,
&cond_place,
mode,
)?
}

View file

@ -440,7 +440,7 @@ pub(crate) fn detect_variant_from_bytes<'a>(
(db.enum_data(e).variants[index.0].0, layout)
}
hir_def::layout::Variants::Multiple { tag, tag_encoding, variants, .. } => {
let size = tag.size(&*target_data_layout).bytes_usize();
let size = tag.size(target_data_layout).bytes_usize();
let offset = layout.fields.offset(0).bytes_usize(); // The only field on enum variants is the tag field
let tag = i128::from_le_bytes(pad16(&b[offset..offset + size], false));
match tag_encoding {