Skip to content

Commit 70f3c79

Browse files
ImplItemKind::TyAlias => ImplItemKind::Type
1 parent 28eda9b commit 70f3c79

File tree

27 files changed

+32
-32
lines changed

27 files changed

+32
-32
lines changed

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,11 +908,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
908908
|this| match ty {
909909
None => {
910910
let ty = this.arena.alloc(this.ty(i.span, hir::TyKind::Err));
911-
hir::ImplItemKind::TyAlias(ty)
911+
hir::ImplItemKind::Type(ty)
912912
}
913913
Some(ty) => {
914914
let ty = this.lower_ty(ty, &ImplTraitContext::TypeAliasesOpaqueTy);
915-
hir::ImplItemKind::TyAlias(ty)
915+
hir::ImplItemKind::Type(ty)
916916
}
917917
},
918918
)

compiler/rustc_hir/src/hir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2315,7 +2315,7 @@ pub enum ImplItemKind<'hir> {
23152315
/// An associated function implementation with the given signature and body.
23162316
Fn(FnSig<'hir>, BodyId),
23172317
/// An associated type.
2318-
TyAlias(&'hir Ty<'hir>),
2318+
Type(&'hir Ty<'hir>),
23192319
}
23202320

23212321
// The name of the associated type for `Fn` return types.

compiler/rustc_hir/src/intravisit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ pub fn walk_impl_item<'v, V: Visitor<'v>>(visitor: &mut V, impl_item: &'v ImplIt
979979
impl_item.hir_id(),
980980
);
981981
}
982-
ImplItemKind::TyAlias(ref ty) => {
982+
ImplItemKind::Type(ref ty) => {
983983
visitor.visit_id(impl_item.hir_id());
984984
visitor.visit_ty(ty);
985985
}

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ fn check_impl_items_against_trait<'tcx>(
10671067
opt_trait_span,
10681068
);
10691069
}
1070-
hir::ImplItemKind::TyAlias(impl_ty) => {
1070+
hir::ImplItemKind::Type(impl_ty) => {
10711071
let opt_trait_span = tcx.hir().span_if_local(ty_trait_item.def_id);
10721072
compare_ty_impl(
10731073
tcx,

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ fn check_impl_item(tcx: TyCtxt<'_>, impl_item: &hir::ImplItem<'_>) {
839839
let (method_sig, span) = match impl_item.kind {
840840
hir::ImplItemKind::Fn(ref sig, _) => (Some(sig), impl_item.span),
841841
// Constrain binding and overflow error spans to `<Ty>` in `type foo = <Ty>`.
842-
hir::ImplItemKind::TyAlias(ty) if ty.span != DUMMY_SP => (None, ty.span),
842+
hir::ImplItemKind::Type(ty) if ty.span != DUMMY_SP => (None, ty.span),
843843
_ => (None, impl_item.span),
844844
};
845845

compiler/rustc_hir_analysis/src/collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ fn convert_impl_item(tcx: TyCtxt<'_>, impl_item_id: hir::ImplItemId) {
738738
hir::ImplItemKind::Fn(..) => {
739739
tcx.ensure().fn_sig(def_id);
740740
}
741-
hir::ImplItemKind::TyAlias(_) => {
741+
hir::ImplItemKind::Type(_) => {
742742
// Account for `type T = _;`
743743
let mut visitor = HirPlaceholderCollector::default();
744744
visitor.visit_impl_item(impl_item);

compiler/rustc_hir_analysis/src/collect/generics_of.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
213213
Node::TraitItem(item) if matches!(item.kind, TraitItemKind::Type(..)) => {
214214
(None, Defaults::Deny)
215215
}
216-
Node::ImplItem(item) if matches!(item.kind, ImplItemKind::TyAlias(..)) => {
216+
Node::ImplItem(item) if matches!(item.kind, ImplItemKind::Type(..)) => {
217217
(None, Defaults::Deny)
218218
}
219219

compiler/rustc_hir_analysis/src/collect/type_of.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
284284
icx.to_ty(ty)
285285
}
286286
}
287-
ImplItemKind::TyAlias(ty) => {
287+
ImplItemKind::Type(ty) => {
288288
if tcx.impl_trait_ref(tcx.hir().get_parent_item(hir_id)).is_none() {
289289
check_feature_inherent_assoc_ty(tcx, item.span);
290290
}

compiler/rustc_hir_analysis/src/hir_wf_check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fn diagnostic_hir_wf_check<'tcx>(
119119
let ty = match loc {
120120
WellFormedLoc::Ty(_) => match hir.get(hir_id) {
121121
hir::Node::ImplItem(item) => match item.kind {
122-
hir::ImplItemKind::TyAlias(ty) => Some(ty),
122+
hir::ImplItemKind::Type(ty) => Some(ty),
123123
hir::ImplItemKind::Const(ty, _) => Some(ty),
124124
ref item => bug!("Unexpected ImplItem {:?}", item),
125125
},

compiler/rustc_hir_pretty/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ impl<'a> State<'a> {
887887
self.end(); // need to close a box
888888
self.ann.nested(self, Nested::Body(body));
889889
}
890-
hir::ImplItemKind::TyAlias(ty) => {
890+
hir::ImplItemKind::Type(ty) => {
891891
self.print_associated_type(ii.ident, ii.generics, None, Some(ty));
892892
}
893893
}

0 commit comments

Comments
 (0)