Skip to content

Commit db1cdd4

Browse files
committed
move 2 candidates into builtin candidate
1 parent b7463e8 commit db1cdd4

File tree

8 files changed

+166
-246
lines changed

8 files changed

+166
-246
lines changed

compiler/rustc_middle/src/traits/mod.rs

-23
Original file line numberDiff line numberDiff line change
@@ -651,12 +651,6 @@ pub enum ImplSource<'tcx, N> {
651651
/// Same as above, but for a function pointer type with the given signature.
652652
FnPointer(ImplSourceFnPointerData<'tcx, N>),
653653

654-
/// ImplSource for a builtin `DeterminantKind` trait implementation.
655-
DiscriminantKind(ImplSourceDiscriminantKindData),
656-
657-
/// ImplSource for a builtin `Pointee` trait implementation.
658-
Pointee(ImplSourcePointeeData),
659-
660654
/// ImplSource automatically generated for a generator.
661655
Generator(ImplSourceGeneratorData<'tcx, N>),
662656

@@ -678,8 +672,6 @@ impl<'tcx, N> ImplSource<'tcx, N> {
678672
ImplSource::Generator(c) => c.nested,
679673
ImplSource::Object(d) => d.nested,
680674
ImplSource::FnPointer(d) => d.nested,
681-
ImplSource::DiscriminantKind(ImplSourceDiscriminantKindData)
682-
| ImplSource::Pointee(ImplSourcePointeeData) => vec![],
683675
ImplSource::TraitAlias(d) => d.nested,
684676
ImplSource::TraitUpcasting(d) => d.nested,
685677
ImplSource::ConstDestruct(i) => i.nested,
@@ -696,8 +688,6 @@ impl<'tcx, N> ImplSource<'tcx, N> {
696688
ImplSource::Generator(c) => &c.nested,
697689
ImplSource::Object(d) => &d.nested,
698690
ImplSource::FnPointer(d) => &d.nested,
699-
ImplSource::DiscriminantKind(ImplSourceDiscriminantKindData)
700-
| ImplSource::Pointee(ImplSourcePointeeData) => &[],
701691
ImplSource::TraitAlias(d) => &d.nested,
702692
ImplSource::TraitUpcasting(d) => &d.nested,
703693
ImplSource::ConstDestruct(i) => &i.nested,
@@ -741,12 +731,6 @@ impl<'tcx, N> ImplSource<'tcx, N> {
741731
fn_ty: p.fn_ty,
742732
nested: p.nested.into_iter().map(f).collect(),
743733
}),
744-
ImplSource::DiscriminantKind(ImplSourceDiscriminantKindData) => {
745-
ImplSource::DiscriminantKind(ImplSourceDiscriminantKindData)
746-
}
747-
ImplSource::Pointee(ImplSourcePointeeData) => {
748-
ImplSource::Pointee(ImplSourcePointeeData)
749-
}
750734
ImplSource::TraitAlias(d) => ImplSource::TraitAlias(ImplSourceTraitAliasData {
751735
alias_def_id: d.alias_def_id,
752736
substs: d.substs,
@@ -856,13 +840,6 @@ pub struct ImplSourceFnPointerData<'tcx, N> {
856840
pub nested: Vec<N>,
857841
}
858842

859-
// FIXME(@lcnr): This should be refactored and merged with other builtin vtables.
860-
#[derive(Clone, Debug, PartialEq, Eq, TyEncodable, TyDecodable, HashStable)]
861-
pub struct ImplSourceDiscriminantKindData;
862-
863-
#[derive(Clone, Debug, PartialEq, Eq, TyEncodable, TyDecodable, HashStable)]
864-
pub struct ImplSourcePointeeData;
865-
866843
#[derive(Clone, PartialEq, Eq, TyEncodable, TyDecodable, HashStable, Lift)]
867844
#[derive(TypeFoldable, TypeVisitable)]
868845
pub struct ImplSourceConstDestructData<N> {

compiler/rustc_middle/src/traits/select.rs

-6
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,6 @@ pub enum SelectionCandidate<'tcx> {
137137
is_const: bool,
138138
},
139139

140-
/// Builtin implementation of `DiscriminantKind`.
141-
DiscriminantKindCandidate,
142-
143-
/// Builtin implementation of `Pointee`.
144-
PointeeCandidate,
145-
146140
TraitAliasCandidate,
147141

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

compiler/rustc_middle/src/traits/structural_impls.rs

-12
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ impl<'tcx, N: fmt::Debug> fmt::Debug for traits::ImplSource<'tcx, N> {
1717

1818
super::ImplSource::FnPointer(ref d) => write!(f, "({:?})", d),
1919

20-
super::ImplSource::DiscriminantKind(ref d) => write!(f, "{:?}", d),
21-
22-
super::ImplSource::Pointee(ref d) => write!(f, "{:?}", d),
23-
2420
super::ImplSource::Object(ref d) => write!(f, "{:?}", d),
2521

2622
super::ImplSource::Param(ref n, ct) => {
@@ -125,11 +121,3 @@ impl<N: fmt::Debug> fmt::Debug for traits::ImplSourceConstDestructData<N> {
125121
write!(f, "ImplSourceConstDestructData(nested={:?})", self.nested)
126122
}
127123
}
128-
129-
///////////////////////////////////////////////////////////////////////////
130-
// Lift implementations
131-
132-
TrivialTypeTraversalAndLiftImpls! {
133-
super::ImplSourceDiscriminantKindData,
134-
super::ImplSourcePointeeData,
135-
}

0 commit comments

Comments
 (0)