Skip to content

Commit c02fd31

Browse files
committed
TraitItemKind::Type -> TraitItemKind::TyAlias.
1 parent f6403c6 commit c02fd31

File tree

11 files changed

+13
-13
lines changed

11 files changed

+13
-13
lines changed

src/librustc/hir/lowering/item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ impl LoweringContext<'_> {
848848
);
849849
(generics, hir::TraitItemKind::Method(sig, hir::TraitMethod::Provided(body_id)))
850850
}
851-
TraitItemKind::Type(ref bounds, ref default) => {
851+
TraitItemKind::TyAlias(ref bounds, ref default) => {
852852
let generics = self.lower_generics(&i.generics, ImplTraitContext::disallowed());
853853
let kind = hir::TraitItemKind::Type(
854854
self.lower_param_bounds(bounds, ImplTraitContext::disallowed()),
@@ -877,7 +877,7 @@ impl LoweringContext<'_> {
877877
TraitItemKind::Const(_, ref default) => {
878878
(hir::AssocItemKind::Const, default.is_some())
879879
}
880-
TraitItemKind::Type(_, ref default) => {
880+
TraitItemKind::TyAlias(_, ref default) => {
881881
(hir::AssocItemKind::Type, default.is_some())
882882
}
883883
TraitItemKind::Method(ref sig, ref default) => (

src/librustc_parse/parser/item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ impl<'a> Parser<'a> {
944944
};
945945
self.expect_semi()?;
946946

947-
Ok((ident, TraitItemKind::Type(bounds, default), generics))
947+
Ok((ident, TraitItemKind::TyAlias(bounds, default), generics))
948948
}
949949

950950
/// Parses a `UseTree`.

src/librustc_resolve/build_reduced_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ impl<'a, 'b> Visitor<'b> for BuildReducedGraphVisitor<'a, 'b> {
11821182
}
11831183
(Res::Def(DefKind::Method, item_def_id), ValueNS)
11841184
}
1185-
TraitItemKind::Type(..) => (Res::Def(DefKind::AssocTy, item_def_id), TypeNS),
1185+
TraitItemKind::TyAlias(..) => (Res::Def(DefKind::AssocTy, item_def_id), TypeNS),
11861186
TraitItemKind::Macro(_) => bug!(), // handled above
11871187
};
11881188

src/librustc_resolve/def_collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
216216
let def_data = match ti.kind {
217217
TraitItemKind::Method(..) | TraitItemKind::Const(..) =>
218218
DefPathData::ValueNs(ti.ident.name),
219-
TraitItemKind::Type(..) => {
219+
TraitItemKind::TyAlias(..) => {
220220
DefPathData::TypeNs(ti.ident.name)
221221
},
222222
TraitItemKind::Macro(..) => return self.visit_macro_invoc(ti.id),

src/librustc_resolve/late.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> {
821821
TraitItemKind::Method(_, _) => {
822822
visit::walk_trait_item(this, trait_item)
823823
}
824-
TraitItemKind::Type(..) => {
824+
TraitItemKind::TyAlias(..) => {
825825
visit::walk_trait_item(this, trait_item)
826826
}
827827
TraitItemKind::Macro(_) => {
@@ -995,7 +995,7 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> {
995995
let trait_assoc_types = replace(
996996
&mut self.diagnostic_metadata.current_trait_assoc_types,
997997
trait_items.iter().filter_map(|item| match &item.kind {
998-
TraitItemKind::Type(bounds, _) if bounds.len() == 0 => Some(item.ident),
998+
TraitItemKind::TyAlias(bounds, _) if bounds.len() == 0 => Some(item.ident),
999999
_ => None,
10001000
}).collect(),
10011001
);

src/librustc_save_analysis/dump_visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
10561056
trait_item.span,
10571057
);
10581058
}
1059-
ast::TraitItemKind::Type(ref bounds, ref default_ty) => {
1059+
ast::TraitItemKind::TyAlias(ref bounds, ref default_ty) => {
10601060
// FIXME do something with _bounds (for type refs)
10611061
let name = trait_item.ident.name.to_string();
10621062
let qualname = format!("::{}",

src/libsyntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@ pub type TraitItem = ImplItem<TraitItemKind>;
16131613
pub enum TraitItemKind {
16141614
Const(P<Ty>, Option<P<Expr>>),
16151615
Method(FnSig, Option<P<Block>>),
1616-
Type(GenericBounds, Option<P<Ty>>),
1616+
TyAlias(GenericBounds, Option<P<Ty>>),
16171617
Macro(Mac),
16181618
}
16191619

src/libsyntax/feature_gate/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
585585
gate_feature_post!(&self, const_fn, ti.span, "const fn is unstable");
586586
}
587587
}
588-
ast::TraitItemKind::Type(_, ref default) => {
588+
ast::TraitItemKind::TyAlias(_, ref default) => {
589589
if let Some(ty) = default {
590590
self.check_impl_trait(ty);
591591
gate_feature_post!(&self, associated_type_defaults, ti.span,

src/libsyntax/mut_visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ pub fn noop_flat_map_trait_item<T: MutVisitor>(mut item: TraitItem, visitor: &mu
955955
visit_fn_sig(sig, visitor);
956956
visit_opt(body, |body| visitor.visit_block(body));
957957
}
958-
TraitItemKind::Type(bounds, default) => {
958+
TraitItemKind::TyAlias(bounds, default) => {
959959
visit_bounds(bounds, visitor);
960960
visit_opt(default, |default| visitor.visit_ty(default));
961961
}

src/libsyntax/print/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,7 @@ impl<'a> State<'a> {
15671567
self.s.word(";");
15681568
}
15691569
}
1570-
ast::TraitItemKind::Type(ref bounds, ref default) => {
1570+
ast::TraitItemKind::TyAlias(ref bounds, ref default) => {
15711571
self.print_associated_type(ti.ident, Some(bounds),
15721572
default.as_ref().map(|ty| &**ty));
15731573
}

0 commit comments

Comments
 (0)