[Syntax Breaking] Rename DefaultImpl to AutoImpl
DefaultImpl is a highly confusing name for what we now call auto impls, as in `impl Send for ..`. The name auto impl is not formally decided but for sanity anything is better than `DefaultImpl` which refers neither to `default impl` nor to `impl Default`.
This commit is contained in:
parent
5ce3d482e2
commit
06506bb751
60 changed files with 163 additions and 163 deletions
|
|
@ -144,7 +144,7 @@ provide! { <'tcx> tcx, def_id, other, cdata,
|
|||
inherent_impls => { Rc::new(cdata.get_inherent_implementations_for_type(def_id.index)) }
|
||||
is_const_fn => { cdata.is_const_fn(def_id.index) }
|
||||
is_foreign_item => { cdata.is_foreign_item(def_id.index) }
|
||||
is_default_impl => { cdata.is_default_impl(def_id.index) }
|
||||
is_auto_impl => { cdata.is_auto_impl(def_id.index) }
|
||||
describe_def => { cdata.get_def(def_id.index) }
|
||||
def_span => { cdata.get_span(def_id.index, &tcx.sess) }
|
||||
lookup_stability => {
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ impl<'tcx> EntryKind<'tcx> {
|
|||
|
||||
EntryKind::ForeignMod |
|
||||
EntryKind::Impl(_) |
|
||||
EntryKind::DefaultImpl(_) |
|
||||
EntryKind::AutoImpl(_) |
|
||||
EntryKind::Field |
|
||||
EntryKind::Generator(_) |
|
||||
EntryKind::Closure(_) => return None,
|
||||
|
|
@ -529,7 +529,7 @@ impl<'a, 'tcx> CrateMetadata {
|
|||
ty::TraitDef::new(self.local_def_id(item_id),
|
||||
data.unsafety,
|
||||
data.paren_sugar,
|
||||
data.has_default_impl,
|
||||
data.has_auto_impl,
|
||||
self.def_path_table.def_path_hash(item_id))
|
||||
}
|
||||
|
||||
|
|
@ -735,7 +735,7 @@ impl<'a, 'tcx> CrateMetadata {
|
|||
continue;
|
||||
}
|
||||
EntryKind::Impl(_) |
|
||||
EntryKind::DefaultImpl(_) => continue,
|
||||
EntryKind::AutoImpl(_) => continue,
|
||||
|
||||
_ => {}
|
||||
}
|
||||
|
|
@ -1082,9 +1082,9 @@ impl<'a, 'tcx> CrateMetadata {
|
|||
self.dllimport_foreign_items.contains(&id)
|
||||
}
|
||||
|
||||
pub fn is_default_impl(&self, impl_id: DefIndex) -> bool {
|
||||
pub fn is_auto_impl(&self, impl_id: DefIndex) -> bool {
|
||||
match self.entry(impl_id).kind {
|
||||
EntryKind::DefaultImpl(_) => true,
|
||||
EntryKind::AutoImpl(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -919,7 +919,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
|
|||
ctor_sig: None,
|
||||
}), repr_options)
|
||||
}
|
||||
hir::ItemDefaultImpl(..) => {
|
||||
hir::ItemAutoImpl(..) => {
|
||||
let data = ImplData {
|
||||
polarity: hir::ImplPolarity::Positive,
|
||||
defaultness: hir::Defaultness::Final,
|
||||
|
|
@ -928,7 +928,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
|
|||
trait_ref: tcx.impl_trait_ref(def_id).map(|trait_ref| self.lazy(&trait_ref)),
|
||||
};
|
||||
|
||||
EntryKind::DefaultImpl(self.lazy(&data))
|
||||
EntryKind::AutoImpl(self.lazy(&data))
|
||||
}
|
||||
hir::ItemImpl(_, polarity, defaultness, ..) => {
|
||||
let trait_ref = tcx.impl_trait_ref(def_id);
|
||||
|
|
@ -970,7 +970,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
|
|||
let data = TraitData {
|
||||
unsafety: trait_def.unsafety,
|
||||
paren_sugar: trait_def.paren_sugar,
|
||||
has_default_impl: tcx.trait_has_default_impl(def_id),
|
||||
has_auto_impl: tcx.trait_has_auto_impl(def_id),
|
||||
super_predicates: self.lazy(&tcx.super_predicates_of(def_id)),
|
||||
};
|
||||
|
||||
|
|
@ -1517,7 +1517,7 @@ impl<'a, 'b, 'tcx> IndexBuilder<'a, 'b, 'tcx> {
|
|||
hir::ItemGlobalAsm(..) |
|
||||
hir::ItemExternCrate(..) |
|
||||
hir::ItemUse(..) |
|
||||
hir::ItemDefaultImpl(..) |
|
||||
hir::ItemAutoImpl(..) |
|
||||
hir::ItemTy(..) => {
|
||||
// no sub-item recording needed in these cases
|
||||
}
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ pub enum EntryKind<'tcx> {
|
|||
Generator(Lazy<GeneratorData<'tcx>>),
|
||||
Trait(Lazy<TraitData<'tcx>>),
|
||||
Impl(Lazy<ImplData<'tcx>>),
|
||||
DefaultImpl(Lazy<ImplData<'tcx>>),
|
||||
AutoImpl(Lazy<ImplData<'tcx>>),
|
||||
Method(Lazy<MethodData<'tcx>>),
|
||||
AssociatedType(AssociatedContainer),
|
||||
AssociatedConst(AssociatedContainer, u8),
|
||||
|
|
@ -359,7 +359,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for EntryKind<'gcx> {
|
|||
EntryKind::Trait(ref trait_data) => {
|
||||
trait_data.hash_stable(hcx, hasher);
|
||||
}
|
||||
EntryKind::DefaultImpl(ref impl_data) |
|
||||
EntryKind::AutoImpl(ref impl_data) |
|
||||
EntryKind::Impl(ref impl_data) => {
|
||||
impl_data.hash_stable(hcx, hasher);
|
||||
}
|
||||
|
|
@ -426,14 +426,14 @@ impl_stable_hash_for!(struct VariantData<'tcx> {
|
|||
pub struct TraitData<'tcx> {
|
||||
pub unsafety: hir::Unsafety,
|
||||
pub paren_sugar: bool,
|
||||
pub has_default_impl: bool,
|
||||
pub has_auto_impl: bool,
|
||||
pub super_predicates: Lazy<ty::GenericPredicates<'tcx>>,
|
||||
}
|
||||
|
||||
impl_stable_hash_for!(struct TraitData<'tcx> {
|
||||
unsafety,
|
||||
paren_sugar,
|
||||
has_default_impl,
|
||||
has_auto_impl,
|
||||
super_predicates
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue