Auto merge of #153832 - matthiaskrgr:rollup-tOzZz0L, r=matthiaskrgr

Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#153418 (core: remove FIXME comment in option.rs FromIterator)
 - rust-lang/rust#153569 (Fix grammar in Pin documentation)
 - rust-lang/rust#153798 (Remove unused `SelectionCandidate::PointerLikeCandidate`)
This commit is contained in:
bors
2026-03-13 20:04:26 +00:00
6 changed files with 4 additions and 32 deletions
@@ -163,9 +163,6 @@ pub enum SelectionCandidate<'tcx> {
/// types generated for a fn pointer type (e.g., `fn(int) -> int`)
FnPointerCandidate,
/// Builtin impl of the `PointerLike` trait.
PointerLikeCandidate,
TraitAliasCandidate,
/// Matching `dyn Trait` with a supertrait of `Trait`. The index is the
@@ -115,11 +115,6 @@ pub(super) fn confirm_candidate(
ImplSource::Builtin(BuiltinImplSource::Misc, data)
}
PointerLikeCandidate => {
let data = self.confirm_pointer_like_candidate(obligation);
ImplSource::Builtin(BuiltinImplSource::Misc, data)
}
TraitAliasCandidate => {
let data = self.confirm_trait_alias_candidate(obligation);
ImplSource::Builtin(BuiltinImplSource::Misc, data)
@@ -638,25 +633,6 @@ fn confirm_fn_pointer_candidate(
Ok(nested)
}
fn confirm_pointer_like_candidate(
&mut self,
obligation: &PolyTraitObligation<'tcx>,
) -> PredicateObligations<'tcx> {
debug!(?obligation, "confirm_pointer_like_candidate");
let placeholder_predicate = self.infcx.enter_forall_and_leak_universe(obligation.predicate);
let self_ty = self.infcx.shallow_resolve(placeholder_predicate.self_ty());
let ty::Pat(base, _) = *self_ty.kind() else { bug!() };
let cause = obligation.derived_cause(ObligationCauseCode::BuiltinDerived);
self.collect_predicates_for_types(
obligation.param_env,
cause,
obligation.recursion_depth + 1,
placeholder_predicate.def_id(),
vec![base],
)
}
fn confirm_trait_alias_candidate(
&mut self,
obligation: &PolyTraitObligation<'tcx>,
@@ -2038,7 +2038,6 @@ fn winnow_candidates(
| TraitUpcastingUnsizeCandidate(_)
| BuiltinObjectCandidate
| BuiltinUnsizeCandidate
| PointerLikeCandidate
| BikeshedGuaranteedNoDropCandidate => false,
// Non-global param candidates have already been handled, global
// where-bounds get ignored.
+3
View File
@@ -155,6 +155,9 @@ pub(crate) fn try_process<I, T, R, F, U>(iter: I, mut f: F) -> ChangeOutputType<
for<'a> F: FnMut(GenericShunt<'a, I, R>) -> U,
R: Residual<U>,
{
// FIXME(#11084): we might be able to get rid of GenericShunt in favor of
// Iterator::scan, as performance should be comparable
let mut residual = None;
let shunt = GenericShunt { iter, residual: &mut residual };
let value = f(shunt);
-3
View File
@@ -2758,9 +2758,6 @@ impl<A, V: FromIterator<A>> FromIterator<Option<A>> for Option<V> {
/// so the final value of `shared` is 6 (= `3 + 2 + 1`), not 16.
#[inline]
fn from_iter<I: IntoIterator<Item = Option<A>>>(iter: I) -> Option<V> {
// FIXME(#11084): This could be replaced with Iterator::scan when this
// performance bug is closed.
iter::try_process(iter.into_iter(), |i| i.collect())
}
}
+1 -1
View File
@@ -600,7 +600,7 @@
//! automatically called [`Pin::get_unchecked_mut`].
//!
//! This can never cause a problem in purely safe code because creating a pinning pointer to
//! a type which has an address-sensitive (thus does not implement `Unpin`) requires `unsafe`,
//! a type which has address-sensitive states (and thus does not implement `Unpin`) requires `unsafe`,
//! but it is important to note that choosing to take advantage of pinning-related guarantees
//! to justify validity in the implementation of your type has consequences for that type's
//! [`Drop`][Drop] implementation as well: if an element of your type could have been pinned,