Skip to content

Commit 5c35c71

Browse files
committed
Rename TyAssocTypeItem -> RequiredAssocTypeItem
1 parent 3aefee7 commit 5c35c71

File tree

12 files changed

+20
-19
lines changed

12 files changed

+20
-19
lines changed

src/librustdoc/clean/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ fn clean_trait_item<'tcx>(trait_item: &hir::TraitItem<'tcx>, cx: &mut DocContext
12591259
hir::TraitItemKind::Type(bounds, None) => {
12601260
let generics = enter_impl_trait(cx, |cx| clean_generics(trait_item.generics, cx));
12611261
let bounds = bounds.iter().filter_map(|x| clean_generic_bound(x, cx)).collect();
1262-
TyAssocTypeItem(generics, bounds)
1262+
RequiredAssocTypeItem(generics, bounds)
12631263
}
12641264
};
12651265
Item::from_def_id_and_parts(local_did, Some(trait_item.ident.name), inner, cx)
@@ -1493,7 +1493,7 @@ pub(crate) fn clean_middle_assoc_item(assoc_item: &ty::AssocItem, cx: &mut DocCo
14931493
bounds,
14941494
)
14951495
} else {
1496-
TyAssocTypeItem(generics, bounds)
1496+
RequiredAssocTypeItem(generics, bounds)
14971497
}
14981498
} else {
14991499
AssocTypeItem(

src/librustdoc/clean/types.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ impl Item {
548548
matches!(self.kind, AssocTypeItem(..) | StrippedItem(box AssocTypeItem(..)))
549549
}
550550
pub(crate) fn is_ty_associated_type(&self) -> bool {
551-
matches!(self.kind, TyAssocTypeItem(..) | StrippedItem(box TyAssocTypeItem(..)))
551+
matches!(self.kind, RequiredAssocTypeItem(..) | StrippedItem(box RequiredAssocTypeItem(..)))
552552
}
553553
pub(crate) fn is_associated_const(&self) -> bool {
554554
matches!(self.kind, ProvidedAssocConstItem(..) | ImplAssocConstItem(..) | StrippedItem(box (ProvidedAssocConstItem(..) | ImplAssocConstItem(..))))
@@ -705,7 +705,7 @@ impl Item {
705705
| ProvidedAssocConstItem(..)
706706
| ImplAssocConstItem(..)
707707
| AssocTypeItem(..)
708-
| TyAssocTypeItem(..)
708+
| RequiredAssocTypeItem(..)
709709
| TyMethodItem(..)
710710
| MethodItem(..) => {
711711
let assoc_item = tcx.associated_item(def_id);
@@ -878,7 +878,7 @@ pub(crate) enum ItemKind {
878878
/// A required associated type in a trait declaration.
879879
///
880880
/// The bounds may be non-empty if there is a `where` clause.
881-
TyAssocTypeItem(Generics, Vec<GenericBound>),
881+
RequiredAssocTypeItem(Generics, Vec<GenericBound>),
882882
/// An associated type in a trait impl or a provided one in a trait declaration.
883883
AssocTypeItem(Box<TypeAlias>, Vec<GenericBound>),
884884
/// An item that has been stripped by a rustdoc pass
@@ -921,7 +921,7 @@ impl ItemKind {
921921
| RequiredAssocConstItem(..)
922922
| ProvidedAssocConstItem(..)
923923
| ImplAssocConstItem(..)
924-
| TyAssocTypeItem(..)
924+
| RequiredAssocTypeItem(..)
925925
| AssocTypeItem(..)
926926
| StrippedItem(_)
927927
| KeywordItem => [].iter(),

src/librustdoc/fold.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub(crate) trait DocFolder: Sized {
9494
| RequiredAssocConstItem(..)
9595
| ProvidedAssocConstItem(..)
9696
| ImplAssocConstItem(..)
97-
| TyAssocTypeItem(..)
97+
| RequiredAssocTypeItem(..)
9898
| AssocTypeItem(..)
9999
| KeywordItem => kind,
100100
}

src/librustdoc/formats/cache.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ impl DocFolder for CacheBuilder<'_, '_> {
340340
| clean::RequiredAssocConstItem(..)
341341
| clean::ProvidedAssocConstItem(..)
342342
| clean::ImplAssocConstItem(..)
343-
| clean::TyAssocTypeItem(..)
343+
| clean::RequiredAssocTypeItem(..)
344344
| clean::AssocTypeItem(..)
345345
| clean::StrippedItem(..)
346346
| clean::KeywordItem => {
@@ -454,7 +454,7 @@ fn add_item_to_search_index(tcx: TyCtxt<'_>, cache: &mut Cache, item: &clean::It
454454
}
455455
clean::TyMethodItem(..)
456456
| clean::RequiredAssocConstItem(..)
457-
| clean::TyAssocTypeItem(..)
457+
| clean::RequiredAssocTypeItem(..)
458458
| clean::StructFieldItem(..)
459459
| clean::VariantItem(..) => {
460460
// Don't index if containing module is stripped (i.e., private),

src/librustdoc/formats/item_type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl<'a> From<&'a clean::Item> for ItemType {
9999
clean::RequiredAssocConstItem(..)
100100
| clean::ProvidedAssocConstItem(..)
101101
| clean::ImplAssocConstItem(..) => ItemType::AssocConst,
102-
clean::TyAssocTypeItem(..) | clean::AssocTypeItem(..) => ItemType::AssocType,
102+
clean::RequiredAssocTypeItem(..) | clean::AssocTypeItem(..) => ItemType::AssocType,
103103
clean::ForeignTypeItem => ItemType::ForeignType,
104104
clean::KeywordItem => ItemType::Keyword,
105105
clean::TraitAliasItem(..) => ItemType::TraitAlias,

src/librustdoc/html/render/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ fn render_assoc_item(
11271127
if parent == ItemType::Trait { 4 } else { 0 },
11281128
cx,
11291129
),
1130-
clean::TyAssocTypeItem(ref generics, ref bounds) => assoc_type(
1130+
clean::RequiredAssocTypeItem(ref generics, ref bounds) => assoc_type(
11311131
w,
11321132
item,
11331133
generics,
@@ -1763,7 +1763,7 @@ fn render_impl(
17631763
);
17641764
w.write_str("</h4></section>");
17651765
}
1766-
clean::TyAssocTypeItem(ref generics, ref bounds) => {
1766+
clean::RequiredAssocTypeItem(ref generics, ref bounds) => {
17671767
let source_id = format!("{item_type}.{name}");
17681768
let id = cx.derive_id(&source_id);
17691769
write!(w, "<section id=\"{id}\" class=\"{item_type}{in_trait_class}\">");
@@ -1839,7 +1839,7 @@ fn render_impl(
18391839
for trait_item in &impl_.items {
18401840
match trait_item.kind {
18411841
clean::MethodItem(..) | clean::TyMethodItem(_) => methods.push(trait_item),
1842-
clean::TyAssocTypeItem(..) | clean::AssocTypeItem(..) => {
1842+
clean::RequiredAssocTypeItem(..) | clean::AssocTypeItem(..) => {
18431843
assoc_types.push(trait_item)
18441844
}
18451845
clean::RequiredAssocConstItem(..)

src/librustdoc/html/render/search_index.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,8 @@ fn simplify_fn_type<'a, 'tcx>(
12101210
&& trait_.items.iter().any(|at| at.is_ty_associated_type())
12111211
{
12121212
for assoc_ty in &trait_.items {
1213-
if let clean::ItemKind::TyAssocTypeItem(_generics, bounds) = &assoc_ty.kind
1213+
if let clean::ItemKind::RequiredAssocTypeItem(_generics, bounds) =
1214+
&assoc_ty.kind
12141215
&& let Some(name) = assoc_ty.name
12151216
{
12161217
let idx = -isize::try_from(rgen.len() + 1).unwrap();

src/librustdoc/json/conversions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ fn from_clean_item(item: clean::Item, renderer: &JsonRenderer<'_>) -> ItemEnum {
347347
type_: ci.type_.into_json(renderer),
348348
value: Some(ci.kind.expr(renderer.tcx)),
349349
},
350-
TyAssocTypeItem(g, b) => ItemEnum::AssocType {
350+
RequiredAssocTypeItem(g, b) => ItemEnum::AssocType {
351351
generics: g.into_json(renderer),
352352
bounds: b.into_json(renderer),
353353
type_: None,

src/librustdoc/passes/check_doc_test_visibility.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub(crate) fn should_have_doc_example(cx: &DocContext<'_>, item: &clean::Item) -
7676
| clean::RequiredAssocConstItem(..)
7777
| clean::ProvidedAssocConstItem(..)
7878
| clean::ImplAssocConstItem(..)
79-
| clean::TyAssocTypeItem(..)
79+
| clean::RequiredAssocTypeItem(..)
8080
// check for trait impl
8181
| clean::ImplItem(box clean::Impl { trait_: Some(_), .. })
8282
)

src/librustdoc/passes/propagate_stability.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl DocFolder for StabilityPropagator<'_, '_> {
7272
| ItemKind::RequiredAssocConstItem(..)
7373
| ItemKind::ProvidedAssocConstItem(..)
7474
| ItemKind::ImplAssocConstItem(..)
75-
| ItemKind::TyAssocTypeItem(..)
75+
| ItemKind::RequiredAssocTypeItem(..)
7676
| ItemKind::AssocTypeItem(..)
7777
| ItemKind::PrimitiveItem(..)
7878
| ItemKind::KeywordItem => own_stability,

src/librustdoc/passes/stripper.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl DocFolder for Stripper<'_, '_> {
123123
// tymethods etc. have no control over privacy
124124
clean::TyMethodItem(..)
125125
| clean::RequiredAssocConstItem(..)
126-
| clean::TyAssocTypeItem(..) => {}
126+
| clean::RequiredAssocTypeItem(..) => {}
127127

128128
// Proc-macros are always public
129129
clean::ProcMacroItem(..) => {}

src/librustdoc/visit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub(crate) trait DocVisitor<'a>: Sized {
4747
| RequiredAssocConstItem(..)
4848
| ProvidedAssocConstItem(..)
4949
| ImplAssocConstItem(..)
50-
| TyAssocTypeItem(..)
50+
| RequiredAssocTypeItem(..)
5151
| AssocTypeItem(..)
5252
| KeywordItem => {}
5353
}

0 commit comments

Comments
 (0)