Skip to content

Commit 509160d

Browse files
committed
Auto merge of #126049 - compiler-errors:rework-use, r=oli-obk
Rework `feature(precise_capturing)` to represent `use<...>` as a syntactical bound Reworks `precise_capturing` for a recent lang-team consensus. Specifically: > The conclusion of the team is that we'll make use<..> a bound. That is, we'll support impl use<..> + Trait, impl Trait + use<..>, etc. > For now, we will support at most one such bound in a list of bounds, and semantically we'll only support these bounds in the item bounds of RPIT-like impl Trait opaque types (i.e., in the places discussed in the RFC). Lang decision in favor of this approach: - rust-lang/rust#125836 (comment) Tracking: - rust-lang/rust#123432
2 parents 096e9af + 192fe3c commit 509160d

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

clippy_lints/src/needless_maybe_sized.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fn type_param_bounds<'tcx>(generics: &'tcx Generics<'tcx>) -> impl Iterator<Item
7373
predicate_pos,
7474
bound_pos,
7575
}),
76-
GenericBound::Outlives(_) => None,
76+
GenericBound::Outlives(_) | GenericBound::Use(..) => None,
7777
})
7878
.filter(|bound| !bound.trait_bound.span.from_expansion()),
7979
)

clippy_utils/src/ast_utils.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -724,11 +724,8 @@ pub fn eq_ty(l: &Ty, r: &Ty) -> bool {
724724
(Tup(l), Tup(r)) => over(l, r, |l, r| eq_ty(l, r)),
725725
(Path(lq, lp), Path(rq, rp)) => both(lq, rq, eq_qself) && eq_path(lp, rp),
726726
(TraitObject(lg, ls), TraitObject(rg, rs)) => ls == rs && over(lg, rg, eq_generic_bound),
727-
(ImplTrait(_, lg, lc), ImplTrait(_, rg, rc)) => {
727+
(ImplTrait(_, lg), ImplTrait(_, rg)) => {
728728
over(lg, rg, eq_generic_bound)
729-
&& both(lc, rc, |lc, rc| {
730-
over(lc.0.as_slice(), rc.0.as_slice(), eq_precise_capture)
731-
})
732729
},
733730
(Typeof(l), Typeof(r)) => eq_expr(&l.value, &r.value),
734731
(MacCall(l), MacCall(r)) => eq_mac_call(l, r),

0 commit comments

Comments
 (0)