Skip to content

Commit ff931a7

Browse files
committed
Auto merge of rust-lang#124961 - matthiaskrgr:rollup-1jj65p6, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#124551 (Add benchmarks for `impl Debug for str`) - rust-lang#124915 (`rustc_target` cleanups) - rust-lang#124918 (Eliminate some `FIXME(lcnr)` comments) - rust-lang#124927 (opt-dist: use xz2 instead of xz crate) - rust-lang#124936 (analyse visitor: build proof tree in probe) - rust-lang#124943 (always use `GenericArgsRef`) - rust-lang#124955 (Use fewer origins when creating type variables.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9523b3f + b8997e3 commit ff931a7

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
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/needless_borrows_for_generic_args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_infer::infer::TyCtxtInferExt;
1313
use rustc_lint::{LateContext, LateLintPass};
1414
use rustc_middle::mir::{Rvalue, StatementKind};
1515
use rustc_middle::ty::{
16-
self, ClauseKind, EarlyBinder, FnSig, GenericArg, GenericArgKind, List, ParamTy, ProjectionPredicate, Ty,
16+
self, ClauseKind, EarlyBinder, FnSig, GenericArg, GenericArgKind, ParamTy, ProjectionPredicate, Ty,
1717
};
1818
use rustc_session::impl_lint_pass;
1919
use rustc_span::symbol::sym;
@@ -161,7 +161,7 @@ fn needless_borrow_count<'tcx>(
161161
cx: &LateContext<'tcx>,
162162
possible_borrowers: &mut Vec<(LocalDefId, PossibleBorrowerMap<'tcx, 'tcx>)>,
163163
fn_id: DefId,
164-
callee_args: &'tcx List<GenericArg<'tcx>>,
164+
callee_args: ty::GenericArgsRef<'tcx>,
165165
arg_index: usize,
166166
param_ty: ParamTy,
167167
mut expr: &Expr<'tcx>,

clippy_utils/src/ty.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use rustc_hir as hir;
1010
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
1111
use rustc_hir::def_id::DefId;
1212
use rustc_hir::{Expr, FnDecl, LangItem, TyKind, Unsafety};
13-
use rustc_infer::infer::type_variable::TypeVariableOrigin;
1413
use rustc_infer::infer::TyCtxtInferExt;
1514
use rustc_lint::LateContext;
1615
use rustc_middle::mir::interpret::Scalar;
@@ -19,7 +18,7 @@ use rustc_middle::traits::EvaluationResult;
1918
use rustc_middle::ty::layout::ValidityRequirement;
2019
use rustc_middle::ty::{
2120
self, AdtDef, AliasTy, AssocKind, Binder, BoundRegion, FnSig, GenericArg, GenericArgKind, GenericArgsRef,
22-
GenericParamDefKind, IntTy, List, ParamEnv, Region, RegionKind, ToPredicate, TraitRef, Ty, TyCtxt,
21+
GenericParamDefKind, IntTy, ParamEnv, Region, RegionKind, ToPredicate, TraitRef, Ty, TyCtxt,
2322
TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, UintTy, VariantDef, VariantDiscr,
2423
};
2524
use rustc_span::symbol::Ident;
@@ -276,11 +275,7 @@ pub fn implements_trait_with_env_from_iter<'tcx>(
276275
.into_iter()
277276
.map(|arg| {
278277
arg.into().unwrap_or_else(|| {
279-
let orig = TypeVariableOrigin {
280-
span: DUMMY_SP,
281-
param_def_id: None,
282-
};
283-
infcx.next_ty_var(orig).into()
278+
infcx.next_ty_var(DUMMY_SP).into()
284279
})
285280
})
286281
.collect::<Vec<_>>();
@@ -961,7 +956,11 @@ pub struct AdtVariantInfo {
961956

962957
impl AdtVariantInfo {
963958
/// Returns ADT variants ordered by size
964-
pub fn new<'tcx>(cx: &LateContext<'tcx>, adt: AdtDef<'tcx>, subst: &'tcx List<GenericArg<'tcx>>) -> Vec<Self> {
959+
pub fn new<'tcx>(
960+
cx: &LateContext<'tcx>,
961+
adt: AdtDef<'tcx>,
962+
subst: GenericArgsRef<'tcx>
963+
) -> Vec<Self> {
965964
let mut variants_size = adt
966965
.variants()
967966
.iter()

0 commit comments

Comments
 (0)