diff options
| author | leonardo.yvens <leoyvens@gmail.com> | 2017-10-09 13:59:20 -0300 |
|---|---|---|
| committer | leonardo.yvens <leoyvens@gmail.com> | 2017-11-03 16:13:20 -0200 |
| commit | 06506bb751ae952b67d76a2ebe21edb8ec96acb9 (patch) | |
| tree | 9894a2984347c30c31cc59c933ce0b1a30007086 /src/librustdoc | |
| parent | 5ce3d482e2313fe6795e6d688e62a092af424da8 (diff) | |
| download | rust-06506bb751ae952b67d76a2ebe21edb8ec96acb9.tar.gz rust-06506bb751ae952b67d76a2ebe21edb8ec96acb9.zip | |
[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`.
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/clean/inline.rs | 6 | ||||
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 8 | ||||
| -rw-r--r-- | src/librustdoc/doctree.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/item_type.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/render.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/passes/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/visit_ast.rs | 4 |
7 files changed, 15 insertions, 15 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 3a4dcc32173..9fb9437e1bc 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -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) { diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index f8fea643d5e..4b60536e1d1 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -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), }), diff --git a/src/librustdoc/doctree.rs b/src/librustdoc/doctree.rs index 71594825cdb..c21bfd8842f 100644 --- a/src/librustdoc/doctree.rs +++ b/src/librustdoc/doctree.rs @@ -44,7 +44,7 @@ pub struct Module { pub stab: Option<attr::Stability>, pub depr: Option<attr::Deprecation>, pub impls: Vec<Impl>, - pub def_traits: Vec<DefaultImpl>, + pub def_traits: Vec<AutoImpl>, pub foreigns: Vec<hir::ForeignMod>, pub macros: Vec<Macro>, pub is_crate: bool, @@ -227,7 +227,7 @@ pub struct Impl { pub id: ast::NodeId, } -pub struct DefaultImpl { +pub struct AutoImpl { pub unsafety: hir::Unsafety, pub trait_: hir::TraitRef, pub id: ast::NodeId, diff --git a/src/librustdoc/html/item_type.rs b/src/librustdoc/html/item_type.rs index c9c5f01f0ae..c214c15ed4b 100644 --- a/src/librustdoc/html/item_type.rs +++ b/src/librustdoc/html/item_type.rs @@ -82,7 +82,7 @@ impl<'a> From<&'a clean::Item> for ItemType { clean::PrimitiveItem(..) => ItemType::Primitive, clean::AssociatedConstItem(..) => ItemType::AssociatedConst, clean::AssociatedTypeItem(..) => ItemType::AssociatedType, - clean::DefaultImplItem(..) => ItemType::Impl, + clean::AutoImplItem(..) => ItemType::Impl, clean::ForeignTypeItem => ItemType::ForeignType, clean::StrippedItem(..) => unreachable!(), } diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index edd01a66075..7e1742c6e10 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1929,7 +1929,7 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context, document(w, cx, item)?; let mut indices = (0..items.len()).filter(|i| { - if let clean::DefaultImplItem(..) = items[*i].inner { + if let clean::AutoImplItem(..) = items[*i].inner { return false; } !items[*i].is_stripped() @@ -3744,7 +3744,7 @@ fn sidebar_module(fmt: &mut fmt::Formatter, _it: &clean::Item, ItemType::TyMethod, ItemType::Method, ItemType::StructField, ItemType::Variant, ItemType::AssociatedType, ItemType::AssociatedConst, ItemType::ForeignType] { if items.iter().any(|it| { - if let clean::DefaultImplItem(..) = it.inner { + if let clean::AutoImplItem(..) = it.inner { false } else { !it.is_stripped() && it.type_() == myty diff --git a/src/librustdoc/passes/mod.rs b/src/librustdoc/passes/mod.rs index 959543404d8..77d97c84c99 100644 --- a/src/librustdoc/passes/mod.rs +++ b/src/librustdoc/passes/mod.rs @@ -116,7 +116,7 @@ impl<'a> fold::DocFolder for Stripper<'a> { // handled in the `strip-priv-imports` pass clean::ExternCrateItem(..) | clean::ImportItem(..) => {} - clean::DefaultImplItem(..) | clean::ImplItem(..) => {} + clean::AutoImplItem(..) | clean::ImplItem(..) => {} // tymethods/macros have no control over privacy clean::MacroItem(..) | clean::TyMethodItem(..) => {} diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 327a330c2a2..bba7ed4e463 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -532,10 +532,10 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { om.impls.push(i); } }, - hir::ItemDefaultImpl(unsafety, ref trait_ref) => { + hir::ItemAutoImpl(unsafety, ref trait_ref) => { // See comment above about ItemImpl. if !self.inlining { - let i = DefaultImpl { + let i = AutoImpl { unsafety, trait_: trait_ref.clone(), id: item.id, |
