Skip to content

Commit 02e11b9

Browse files
committed
Auto merge of rust-lang#122900 - matthiaskrgr:rollup-nls90mb, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#114009 (compiler: allow transmute of ZST arrays with generics) - rust-lang#122195 (Note that the caller chooses a type for type param) - rust-lang#122651 (Suggest `_` for missing generic arguments in turbofish) - rust-lang#122784 (Add `tag_for_variant` query) - rust-lang#122839 (Split out `PredicatePolarity` from `ImplPolarity`) - rust-lang#122873 (Merge my contributor emails into one using mailmap) - rust-lang#122885 (Adjust better spastorino membership to triagebot's adhoc_groups) - rust-lang#122888 (add a couple more tests) r? `@ghost` `@rustbot` modify labels: rollup
2 parents f9ad628 + 8b14a36 commit 02e11b9

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

clippy_lints/src/derive.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_lint::{LateContext, LateLintPass};
1111
use rustc_middle::hir::nested_filter;
1212
use rustc_middle::traits::Reveal;
1313
use rustc_middle::ty::{
14-
self, ClauseKind, GenericArgKind, GenericParamDefKind, ImplPolarity, ParamEnv, ToPredicate, TraitPredicate, Ty,
14+
self, ClauseKind, GenericArgKind, GenericParamDefKind, ParamEnv, ToPredicate, TraitPredicate, Ty,
1515
TyCtxt,
1616
};
1717
use rustc_session::declare_lint_pass;
@@ -502,7 +502,7 @@ fn param_env_for_derived_eq(tcx: TyCtxt<'_>, did: DefId, eq_trait_id: DefId) ->
502502
params.iter().filter(|&&(_, needs_eq)| needs_eq).map(|&(param, _)| {
503503
ClauseKind::Trait(TraitPredicate {
504504
trait_ref: ty::TraitRef::new(tcx, eq_trait_id, [tcx.mk_param_from_def(param)]),
505-
polarity: ImplPolarity::Positive,
505+
polarity: ty::PredicatePolarity::Positive,
506506
})
507507
.to_predicate(tcx)
508508
}),

clippy_lints/src/eta_reduction.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_hir::{BindingAnnotation, Expr, ExprKind, FnRetTy, Param, PatKind, QPat
99
use rustc_infer::infer::TyCtxtInferExt;
1010
use rustc_lint::{LateContext, LateLintPass};
1111
use rustc_middle::ty::{
12-
self, Binder, ClosureArgs, ClosureKind, FnSig, GenericArg, GenericArgKind, ImplPolarity, List, Region, RegionKind,
12+
self, Binder, ClosureArgs, ClosureKind, FnSig, GenericArg, GenericArgKind, List, Region, RegionKind,
1313
Ty, TypeVisitableExt, TypeckResults,
1414
};
1515
use rustc_session::declare_lint_pass;
@@ -173,7 +173,7 @@ impl<'tcx> LateLintPass<'tcx> for EtaReduction {
173173
if let Ok((ClosureKind::FnMut, _)) = cx.tcx.infer_ctxt().build().type_implements_fn_trait(
174174
cx.param_env,
175175
Binder::bind_with_vars(callee_ty_adjusted, List::empty()),
176-
ImplPolarity::Positive,
176+
ty::PredicatePolarity::Positive,
177177
) && path_to_local(callee).map_or(false, |l| {
178178
local_used_in(cx, l, args) || local_used_after_expr(cx, l, expr)
179179
}) {

clippy_lints/src/methods/unnecessary_to_owned.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use rustc_lint::LateContext;
1818
use rustc_middle::mir::Mutability;
1919
use rustc_middle::ty::adjustment::{Adjust, Adjustment, OverloadedDeref};
2020
use rustc_middle::ty::{
21-
self, ClauseKind, GenericArg, GenericArgKind, GenericArgsRef, ImplPolarity, ParamTy, ProjectionPredicate,
21+
self, ClauseKind, GenericArg, GenericArgKind, GenericArgsRef, ParamTy, ProjectionPredicate,
2222
TraitPredicate, Ty,
2323
};
2424
use rustc_span::{sym, Symbol};
@@ -666,7 +666,7 @@ fn check_borrow_predicate<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) {
666666
&& let Some(borrow_id) = cx.tcx.get_diagnostic_item(sym::Borrow)
667667
&& cx.tcx.predicates_of(method_def_id).predicates.iter().any(|(pred, _)| {
668668
if let ClauseKind::Trait(trait_pred) = pred.kind().skip_binder()
669-
&& trait_pred.polarity == ImplPolarity::Positive
669+
&& trait_pred.polarity == ty::PredicatePolarity::Positive
670670
&& trait_pred.trait_ref.def_id == borrow_id
671671
{
672672
true

tests/ui/builtin_type_shadow.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ LL | 42
1919
|
2020
= note: expected type parameter `u32`
2121
found type `{integer}`
22+
= note: the caller chooses a type for `u32` which can be different from `i32`
2223

2324
error: aborting due to 2 previous errors
2425

0 commit comments

Comments
 (0)