Skip to content

Commit 6b516ba

Browse files
committed
Auto merge of rust-lang#3597 - rust-lang:rustup-2024-05-11, r=RalfJung
Automatic Rustup
2 parents 22838e8 + 2a6d285 commit 6b516ba

Some content is hidden

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

42 files changed

+258
-290
lines changed

clippy_lints/src/default_union_representation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_help;
22
use rustc_hir::{HirId, Item, ItemKind};
33
use rustc_lint::{LateContext, LateLintPass};
44
use rustc_middle::ty::layout::LayoutOf;
5-
use rustc_middle::ty::{self, FieldDef, GenericArg, List};
5+
use rustc_middle::ty::{self, FieldDef};
66
use rustc_session::declare_lint_pass;
77
use rustc_span::sym;
88

@@ -85,7 +85,7 @@ fn is_union_with_two_non_zst_fields<'tcx>(cx: &LateContext<'tcx>, item: &Item<'t
8585
}
8686
}
8787

88-
fn is_zst<'tcx>(cx: &LateContext<'tcx>, field: &FieldDef, args: &'tcx List<GenericArg<'tcx>>) -> bool {
88+
fn is_zst<'tcx>(cx: &LateContext<'tcx>, field: &FieldDef, args: ty::GenericArgsRef<'tcx>) -> bool {
8989
let ty = field.ty(cx.tcx, args);
9090
if let Ok(layout) = cx.layout_of(ty) {
9191
layout.is_zst()

clippy_lints/src/dereference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ impl<'tcx> LateLintPass<'tcx> for Dereferencing<'tcx> {
382382
cx,
383383
impl_ty,
384384
trait_id,
385-
&args[..cx.tcx.generics_of(trait_id).params.len() - 1],
385+
&args[..cx.tcx.generics_of(trait_id).own_params.len() - 1],
386386
)
387387
{
388388
false

clippy_lints/src/derive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ fn param_env_for_derived_eq(tcx: TyCtxt<'_>, did: DefId, eq_trait_id: DefId) ->
480480
// Vec<(param_def, needs_eq)>
481481
let mut params = tcx
482482
.generics_of(did)
483-
.params
483+
.own_params
484484
.iter()
485485
.map(|p| (p, matches!(p.kind, GenericParamDefKind::Type { .. })))
486486
.collect::<Vec<_>>();

clippy_lints/src/future_not_send.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use rustc_hir::{Body, FnDecl};
55
use rustc_infer::infer::TyCtxtInferExt;
66
use rustc_lint::{LateContext, LateLintPass};
77
use rustc_middle::ty::{self, AliasTy, ClauseKind, PredicateKind};
8+
use rustc_middle::ty::print::PrintTraitRefExt;
89
use rustc_session::declare_lint_pass;
910
use rustc_span::def_id::LocalDefId;
1011
use rustc_span::{sym, Span};

clippy_lints/src/implied_bounds_in_impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ fn try_resolve_type<'tcx>(
148148
match args.get(index - 1) {
149149
Some(GenericArg::Type(ty)) => Some(lower_ty(tcx, ty)),
150150
Some(_) => None,
151-
None => Some(tcx.type_of(generics.params[index].def_id).skip_binder()),
151+
None => Some(tcx.type_of(generics.own_params[index].def_id).skip_binder()),
152152
}
153153
}
154154

clippy_lints/src/iter_without_into_iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl {self_ty_without_ref} {{
225225
&& let ImplItemKind::Fn(sig, _) = item.kind
226226
&& let FnRetTy::Return(ret) = sig.decl.output
227227
&& is_nameable_in_impl_trait(ret)
228-
&& cx.tcx.generics_of(item_did).params.is_empty()
228+
&& cx.tcx.generics_of(item_did).own_params.is_empty()
229229
&& sig.decl.implicit_self == expected_implicit_self
230230
&& sig.decl.inputs.len() == 1
231231
&& let Some(imp) = get_parent_as_impl(cx.tcx, item.hir_id())

clippy_lints/src/manual_assert.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
use crate::rustc_lint::LintContext;
21
use clippy_utils::diagnostics::span_lint_and_then;
32
use clippy_utils::macros::{is_panic, root_macro_call};
43
use clippy_utils::{is_else_clause, is_parent_stmt, peel_blocks_with_stmt, span_extract_comment, sugg};
54
use rustc_errors::Applicability;
65
use rustc_hir::{Expr, ExprKind, UnOp};
7-
use rustc_lint::{LateContext, LateLintPass};
6+
use rustc_lint::{LateContext, LateLintPass, LintContext};
87
use rustc_session::declare_lint_pass;
98

109
declare_clippy_lint! {

clippy_lints/src/matches/significant_drop_in_scrutinee.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc_errors::{Applicability, Diag};
66
use rustc_hir::intravisit::{walk_expr, Visitor};
77
use rustc_hir::{Arm, Expr, ExprKind, MatchSource};
88
use rustc_lint::{LateContext, LintContext};
9-
use rustc_middle::ty::{GenericArgKind, Ty, TypeAndMut};
9+
use rustc_middle::ty::{GenericArgKind, Ty};
1010
use rustc_span::Span;
1111

1212
use super::SIGNIFICANT_DROP_IN_SCRUTINEE;
@@ -234,9 +234,9 @@ impl<'a, 'tcx> SigDropHelper<'a, 'tcx> {
234234
}
235235
let ty = self.sig_drop_checker.get_type(expr);
236236
if ty.is_ref() {
237-
// We checked that the type was ref, so builtin_deref will return Some TypeAndMut,
238-
// but let's avoid any chance of an ICE
239-
if let Some(TypeAndMut { ty, .. }) = ty.builtin_deref(true) {
237+
// We checked that the type was ref, so builtin_deref will return Some,
238+
// but let's avoid any chance of an ICE.
239+
if let Some(ty) = ty.builtin_deref(true) {
240240
if ty.is_trivially_pure_clone_copy() {
241241
self.replace_current_sig_drop(expr.span, false, LintSuggestion::MoveAndDerefToCopy);
242242
} else if allow_move_and_clone {

clippy_lints/src/methods/iter_overeager_cloned.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use rustc_lint::LateContext;
99
use rustc_middle::mir::{FakeReadCause, Mutability};
1010
use rustc_middle::ty::{self, BorrowKind};
1111
use rustc_span::sym;
12+
use rustc_trait_selection::infer::TyCtxtInferExt;
1213

1314
use super::ITER_OVEREAGER_CLONED;
1415
use crate::redundant_clone::REDUNDANT_CLONE;
15-
use crate::rustc_trait_selection::infer::TyCtxtInferExt;
1616

1717
#[derive(Clone, Copy)]
1818
pub(super) enum Op<'a> {

clippy_lints/src/mismatching_type_param_order.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeParamMismatch {
7676
};
7777

7878
// get the names of the generic parameters in the type
79-
let type_params = &cx.tcx.generics_of(defid).params;
79+
let type_params = &cx.tcx.generics_of(defid).own_params;
8080
let type_param_names: Vec<_> = type_params
8181
.iter()
8282
.filter_map(|p| match p.kind {

0 commit comments

Comments
 (0)