Skip to content

Commit

Permalink
Auto merge of rust-lang#124961 - matthiaskrgr:rollup-1jj65p6, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

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
  • Loading branch information
bors committed May 10, 2024
2 parents 9523b3f + b8997e3 commit ff931a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/default_union_representation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_help;
use rustc_hir::{HirId, Item, ItemKind};
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::ty::layout::LayoutOf;
use rustc_middle::ty::{self, FieldDef, GenericArg, List};
use rustc_middle::ty::{self, FieldDef};
use rustc_session::declare_lint_pass;
use rustc_span::sym;

Expand Down Expand Up @@ -85,7 +85,7 @@ fn is_union_with_two_non_zst_fields<'tcx>(cx: &LateContext<'tcx>, item: &Item<'t
}
}

fn is_zst<'tcx>(cx: &LateContext<'tcx>, field: &FieldDef, args: &'tcx List<GenericArg<'tcx>>) -> bool {
fn is_zst<'tcx>(cx: &LateContext<'tcx>, field: &FieldDef, args: ty::GenericArgsRef<'tcx>) -> bool {
let ty = field.ty(cx.tcx, args);
if let Ok(layout) = cx.layout_of(ty) {
layout.is_zst()
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/needless_borrows_for_generic_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use rustc_infer::infer::TyCtxtInferExt;
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::mir::{Rvalue, StatementKind};
use rustc_middle::ty::{
self, ClauseKind, EarlyBinder, FnSig, GenericArg, GenericArgKind, List, ParamTy, ProjectionPredicate, Ty,
self, ClauseKind, EarlyBinder, FnSig, GenericArg, GenericArgKind, ParamTy, ProjectionPredicate, Ty,
};
use rustc_session::impl_lint_pass;
use rustc_span::symbol::sym;
Expand Down Expand Up @@ -161,7 +161,7 @@ fn needless_borrow_count<'tcx>(
cx: &LateContext<'tcx>,
possible_borrowers: &mut Vec<(LocalDefId, PossibleBorrowerMap<'tcx, 'tcx>)>,
fn_id: DefId,
callee_args: &'tcx List<GenericArg<'tcx>>,
callee_args: ty::GenericArgsRef<'tcx>,
arg_index: usize,
param_ty: ParamTy,
mut expr: &Expr<'tcx>,
Expand Down
15 changes: 7 additions & 8 deletions clippy_utils/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use rustc_hir as hir;
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
use rustc_hir::def_id::DefId;
use rustc_hir::{Expr, FnDecl, LangItem, TyKind, Unsafety};
use rustc_infer::infer::type_variable::TypeVariableOrigin;
use rustc_infer::infer::TyCtxtInferExt;
use rustc_lint::LateContext;
use rustc_middle::mir::interpret::Scalar;
Expand All @@ -19,7 +18,7 @@ use rustc_middle::traits::EvaluationResult;
use rustc_middle::ty::layout::ValidityRequirement;
use rustc_middle::ty::{
self, AdtDef, AliasTy, AssocKind, Binder, BoundRegion, FnSig, GenericArg, GenericArgKind, GenericArgsRef,
GenericParamDefKind, IntTy, List, ParamEnv, Region, RegionKind, ToPredicate, TraitRef, Ty, TyCtxt,
GenericParamDefKind, IntTy, ParamEnv, Region, RegionKind, ToPredicate, TraitRef, Ty, TyCtxt,
TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, UintTy, VariantDef, VariantDiscr,
};
use rustc_span::symbol::Ident;
Expand Down Expand Up @@ -276,11 +275,7 @@ pub fn implements_trait_with_env_from_iter<'tcx>(
.into_iter()
.map(|arg| {
arg.into().unwrap_or_else(|| {
let orig = TypeVariableOrigin {
span: DUMMY_SP,
param_def_id: None,
};
infcx.next_ty_var(orig).into()
infcx.next_ty_var(DUMMY_SP).into()
})
})
.collect::<Vec<_>>();
Expand Down Expand Up @@ -961,7 +956,11 @@ pub struct AdtVariantInfo {

impl AdtVariantInfo {
/// Returns ADT variants ordered by size
pub fn new<'tcx>(cx: &LateContext<'tcx>, adt: AdtDef<'tcx>, subst: &'tcx List<GenericArg<'tcx>>) -> Vec<Self> {
pub fn new<'tcx>(
cx: &LateContext<'tcx>,
adt: AdtDef<'tcx>,
subst: GenericArgsRef<'tcx>
) -> Vec<Self> {
let mut variants_size = adt
.variants()
.iter()
Expand Down

0 comments on commit ff931a7

Please sign in to comment.