Skip to content

Commit 567e1bb

Browse files
committed
Auto merge of #101432 - nnethercote:shrink-PredicateS, r=lcnr
Shrink `PredicateS` r? `@ghost`
2 parents 9cbbd4a + 2d4349c commit 567e1bb

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

clippy_lints/src/dereference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ fn replace_types<'tcx>(
11751175
if replaced.insert(param_ty.index) {
11761176
for projection_predicate in projection_predicates {
11771177
if projection_predicate.projection_ty.self_ty() == param_ty.to_ty(cx.tcx)
1178-
&& let ty::Term::Ty(term_ty) = projection_predicate.term
1178+
&& let Some(term_ty) = projection_predicate.term.ty()
11791179
&& let ty::Param(term_param_ty) = term_ty.kind()
11801180
{
11811181
let item_def_id = projection_predicate.projection_ty.item_def_id;

clippy_lints/src/methods/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3304,9 +3304,9 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
33043304
// one of the associated types must be Self
33053305
for &(predicate, _span) in cx.tcx.explicit_item_bounds(def_id) {
33063306
if let ty::PredicateKind::Projection(projection_predicate) = predicate.kind().skip_binder() {
3307-
let assoc_ty = match projection_predicate.term {
3308-
ty::Term::Ty(ty) => ty,
3309-
ty::Term::Const(_c) => continue,
3307+
let assoc_ty = match projection_predicate.term.unpack() {
3308+
ty::TermKind::Ty(ty) => ty,
3309+
ty::TermKind::Const(_c) => continue,
33103310
};
33113311
// walk the associated type and check for Self
33123312
if let Some(self_adt) = self_ty.ty_adt_def() {

clippy_lints/src/methods/unnecessary_to_owned.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ fn check_other_call_arg<'tcx>(
274274
.subst_and_normalize_erasing_regions(call_substs, cx.param_env, projection_predicate.term);
275275
implements_trait(cx, receiver_ty, deref_trait_id, &[])
276276
&& get_associated_type(cx, receiver_ty, deref_trait_id, "Target")
277-
.map_or(false, |ty| ty::Term::Ty(ty) == normalized_ty)
277+
.map_or(false, |ty| ty::TermKind::Ty(ty) == normalized_ty.unpack())
278278
} else {
279279
false
280280
}

0 commit comments

Comments
 (0)