Skip to content

Commit cc41ba4

Browse files
authored
Rollup merge of #153798 - zachs18:remove-pointerlikecandidate, r=JohnTitor
Remove unused `SelectionCandidate::PointerLikeCandidate` The `PointerLike` trait was removed in #143308, as part of `dyn*` being removed. `!null` pattern types were added in #142339 , which added `SelectionCandidate::PointerLikeCandidate`, IIUC to allow pattern types to implement `PointerLike`, but `PointerLike` was removed after that PR was first written, so (I assume) that functionality was mostly removed on a rebase, but this part didn't get removed. (see an earlier version of that PR that mentioned `LangItem::PointerLike`: 50cab82 before it got rebased over the rollup containing 143308: #142339 (comment) ) cc @oli-obk
2 parents 42c7f52 + 814c750 commit cc41ba4

File tree

3 files changed

+0
-28
lines changed

3 files changed

+0
-28
lines changed

‎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.

0 commit comments

Comments
 (0)