Skip to content

Commit 1d8897a

Browse files
committed
Auto merge of #153832 - matthiaskrgr:rollup-tOzZz0L, r=matthiaskrgr
Rollup of 3 pull requests Successful merges: - #153418 (core: remove FIXME comment in option.rs FromIterator) - #153569 (Fix grammar in Pin documentation) - #153798 (Remove unused `SelectionCandidate::PointerLikeCandidate`)
2 parents f1ceedf + cc41ba4 commit 1d8897a

6 files changed

Lines changed: 4 additions & 32 deletions

File tree

compiler/rustc_middle/src/traits/select.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,6 @@ pub enum SelectionCandidate<'tcx> {
163163
/// types generated for a fn pointer type (e.g., `fn(int) -> int`)
164164
FnPointerCandidate,
165165

166-
/// Builtin impl of the `PointerLike` trait.
167-
PointerLikeCandidate,
168-
169166
TraitAliasCandidate,
170167

171168
/// Matching `dyn Trait` with a supertrait of `Trait`. The index is the

compiler/rustc_trait_selection/src/traits/select/confirmation.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
115115
ImplSource::Builtin(BuiltinImplSource::Misc, data)
116116
}
117117

118-
PointerLikeCandidate => {
119-
let data = self.confirm_pointer_like_candidate(obligation);
120-
ImplSource::Builtin(BuiltinImplSource::Misc, data)
121-
}
122-
123118
TraitAliasCandidate => {
124119
let data = self.confirm_trait_alias_candidate(obligation);
125120
ImplSource::Builtin(BuiltinImplSource::Misc, data)
@@ -638,25 +633,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
638633
Ok(nested)
639634
}
640635

641-
fn confirm_pointer_like_candidate(
642-
&mut self,
643-
obligation: &PolyTraitObligation<'tcx>,
644-
) -> PredicateObligations<'tcx> {
645-
debug!(?obligation, "confirm_pointer_like_candidate");
646-
let placeholder_predicate = self.infcx.enter_forall_and_leak_universe(obligation.predicate);
647-
let self_ty = self.infcx.shallow_resolve(placeholder_predicate.self_ty());
648-
let ty::Pat(base, _) = *self_ty.kind() else { bug!() };
649-
let cause = obligation.derived_cause(ObligationCauseCode::BuiltinDerived);
650-
651-
self.collect_predicates_for_types(
652-
obligation.param_env,
653-
cause,
654-
obligation.recursion_depth + 1,
655-
placeholder_predicate.def_id(),
656-
vec![base],
657-
)
658-
}
659-
660636
fn confirm_trait_alias_candidate(
661637
&mut self,
662638
obligation: &PolyTraitObligation<'tcx>,

compiler/rustc_trait_selection/src/traits/select/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,6 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
20382038
| TraitUpcastingUnsizeCandidate(_)
20392039
| BuiltinObjectCandidate
20402040
| BuiltinUnsizeCandidate
2041-
| PointerLikeCandidate
20422041
| BikeshedGuaranteedNoDropCandidate => false,
20432042
// Non-global param candidates have already been handled, global
20442043
// where-bounds get ignored.

library/core/src/iter/adapters/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ where
155155
for<'a> F: FnMut(GenericShunt<'a, I, R>) -> U,
156156
R: Residual<U>,
157157
{
158+
// FIXME(#11084): we might be able to get rid of GenericShunt in favor of
159+
// Iterator::scan, as performance should be comparable
160+
158161
let mut residual = None;
159162
let shunt = GenericShunt { iter, residual: &mut residual };
160163
let value = f(shunt);

library/core/src/option.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,9 +2758,6 @@ impl<A, V: FromIterator<A>> FromIterator<Option<A>> for Option<V> {
27582758
/// so the final value of `shared` is 6 (= `3 + 2 + 1`), not 16.
27592759
#[inline]
27602760
fn from_iter<I: IntoIterator<Item = Option<A>>>(iter: I) -> Option<V> {
2761-
// FIXME(#11084): This could be replaced with Iterator::scan when this
2762-
// performance bug is closed.
2763-
27642761
iter::try_process(iter.into_iter(), |i| i.collect())
27652762
}
27662763
}

library/core/src/pin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@
600600
//! automatically called [`Pin::get_unchecked_mut`].
601601
//!
602602
//! This can never cause a problem in purely safe code because creating a pinning pointer to
603-
//! a type which has an address-sensitive (thus does not implement `Unpin`) requires `unsafe`,
603+
//! a type which has address-sensitive states (and thus does not implement `Unpin`) requires `unsafe`,
604604
//! but it is important to note that choosing to take advantage of pinning-related guarantees
605605
//! to justify validity in the implementation of your type has consequences for that type's
606606
//! [`Drop`][Drop] implementation as well: if an element of your type could have been pinned,

0 commit comments

Comments
 (0)