[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:
leonardo.yvens 2017-10-09 13:59:20 -03:00
parent 5ce3d482e2
commit 06506bb751
60 changed files with 163 additions and 163 deletions

View file

@ -292,10 +292,10 @@ pub fn build_impl(cx: &DocContext, did: DefId, ret: &mut Vec<clean::Item>) {
}
}
// If this is a defaulted impl, then bail out early here
if tcx.is_default_impl(did) {
// If this is an auto impl, then bail out early here
if tcx.is_auto_impl(did) {
return ret.push(clean::Item {
inner: clean::DefaultImplItem(clean::DefaultImpl {
inner: clean::AutoImplItem(clean::AutoImpl {
// FIXME: this should be decoded
unsafety: hir::Unsafety::Normal,
trait_: match associated_trait.as_ref().unwrap().clean(cx) {

View file

@ -425,7 +425,7 @@ pub enum ItemEnum {
PrimitiveItem(PrimitiveType),
AssociatedConstItem(Type, Option<String>),
AssociatedTypeItem(Vec<TyParamBound>, Option<Type>),
DefaultImplItem(DefaultImpl),
AutoImplItem(AutoImpl),
/// An item that has been stripped by a rustdoc pass
StrippedItem(Box<ItemEnum>),
}
@ -2733,12 +2733,12 @@ fn build_deref_target_impls(cx: &DocContext,
}
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
pub struct DefaultImpl {
pub struct AutoImpl {
pub unsafety: hir::Unsafety,
pub trait_: Type,
}
impl Clean<Item> for doctree::DefaultImpl {
impl Clean<Item> for doctree::AutoImpl {
fn clean(&self, cx: &DocContext) -> Item {
Item {
name: None,
@ -2748,7 +2748,7 @@ impl Clean<Item> for doctree::DefaultImpl {
visibility: Some(Public),
stability: None,
deprecation: None,
inner: DefaultImplItem(DefaultImpl {
inner: AutoImplItem(AutoImpl {
unsafety: self.unsafety,
trait_: self.trait_.clean(cx),
}),