Skip to content

Commit cdbbf3a

Browse files
authored
Rustup (#15243)
r? @ghost changelog: none
2 parents 49ca220 + b9af667 commit cdbbf3a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+162
-99
lines changed

clippy_dev/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
rustc_private,
33
exit_status_error,
44
if_let_guard,
5-
let_chains,
65
os_str_slice,
76
os_string_truncate,
87
slice_split_once

clippy_lints/src/approx_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl ApproxConstant {
7474
}
7575

7676
impl LateLintPass<'_> for ApproxConstant {
77-
fn check_lit(&mut self, cx: &LateContext<'_>, _hir_id: HirId, lit: &Lit, _negated: bool) {
77+
fn check_lit(&mut self, cx: &LateContext<'_>, _hir_id: HirId, lit: Lit, _negated: bool) {
7878
match lit.node {
7979
LitKind::Float(s, LitFloatType::Suffixed(fty)) => match fty {
8080
FloatTy::F16 => self.check_known_consts(cx, lit.span, s, "f16"),

clippy_lints/src/arbitrary_source_item_ordering.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
266266
.tcx
267267
.hir_attrs(item.hir_id())
268268
.iter()
269-
.any(|attr| matches!(attr, Attribute::Parsed(AttributeKind::Repr(..))))
269+
.any(|attr| matches!(attr, Attribute::Parsed(AttributeKind::Repr { .. })))
270270
{
271271
// Do not lint items with a `#[repr]` attribute as their layout may be imposed by an external API.
272272
return;

clippy_lints/src/attrs/repr_attributes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use clippy_utils::msrvs::{self, Msrv};
99
use super::REPR_PACKED_WITHOUT_ABI;
1010

1111
pub(super) fn check(cx: &LateContext<'_>, item_span: Span, attrs: &[Attribute], msrv: Msrv) {
12-
if let Some(reprs) = find_attr!(attrs, AttributeKind::Repr(r) => r) {
12+
if let Some(reprs) = find_attr!(attrs, AttributeKind::Repr { reprs, .. } => reprs) {
1313
let packed_span = reprs
1414
.iter()
1515
.find(|(r, _)| matches!(r, ReprAttr::ReprPacked(..)))

clippy_lints/src/bool_assert_comparison.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn extract_bool_lit(e: &Expr<'_>) -> Option<bool> {
4242
}) = e.kind
4343
&& !e.span.from_expansion()
4444
{
45-
Some(*b)
45+
Some(b)
4646
} else {
4747
None
4848
}

clippy_lints/src/casts/fn_to_numeric_cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_expr: &Expr<'_>,
1717
ty::FnDef(..) | ty::FnPtr(..) => {
1818
let mut applicability = Applicability::MaybeIncorrect;
1919

20-
if to_nbits >= cx.tcx.data_layout.pointer_size.bits() && !cast_to.is_usize() {
20+
if to_nbits >= cx.tcx.data_layout.pointer_size().bits() && !cast_to.is_usize() {
2121
let from_snippet = snippet_with_applicability(cx, cast_expr.span, "x", &mut applicability);
2222
span_lint_and_sugg(
2323
cx,

clippy_lints/src/casts/fn_to_numeric_cast_with_truncation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_expr: &Expr<'_>,
1717
let mut applicability = Applicability::MaybeIncorrect;
1818
let from_snippet = snippet_with_applicability(cx, cast_expr.span, "x", &mut applicability);
1919

20-
if to_nbits < cx.tcx.data_layout.pointer_size.bits() {
20+
if to_nbits < cx.tcx.data_layout.pointer_size().bits() {
2121
span_lint_and_sugg(
2222
cx,
2323
FN_TO_NUMERIC_CAST_WITH_TRUNCATION,

clippy_lints/src/casts/manual_dangling_ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, from: &Expr<'_>, to:
4646
fn is_expr_const_aligned(cx: &LateContext<'_>, expr: &Expr<'_>, to: &Ty<'_>) -> bool {
4747
match expr.kind {
4848
ExprKind::Call(fun, _) => is_align_of_call(cx, fun, to),
49-
ExprKind::Lit(lit) => is_literal_aligned(cx, lit, to),
49+
ExprKind::Lit(lit) => is_literal_aligned(cx, &lit, to),
5050
_ => false,
5151
}
5252
}

clippy_lints/src/casts/unnecessary_cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ fn lint_unnecessary_cast(
243243
);
244244
}
245245

246-
fn get_numeric_literal<'e>(expr: &'e Expr<'e>) -> Option<&'e Lit> {
246+
fn get_numeric_literal<'e>(expr: &'e Expr<'e>) -> Option<Lit> {
247247
match expr.kind {
248248
ExprKind::Lit(lit) => Some(lit),
249249
ExprKind::Unary(UnOp::Neg, e) => {

clippy_lints/src/casts/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_middle::ty::{self, AdtDef, IntTy, Ty, TyCtxt, UintTy, VariantDiscr};
55
/// integral type.
66
pub(super) fn int_ty_to_nbits(tcx: TyCtxt<'_>, ty: Ty<'_>) -> Option<u64> {
77
match ty.kind() {
8-
ty::Int(IntTy::Isize) | ty::Uint(UintTy::Usize) => Some(tcx.data_layout.pointer_size.bits()),
8+
ty::Int(IntTy::Isize) | ty::Uint(UintTy::Usize) => Some(tcx.data_layout.pointer_size().bits()),
99
ty::Int(i) => i.bit_width(),
1010
ty::Uint(i) => i.bit_width(),
1111
_ => None,

0 commit comments

Comments
 (0)