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
}

compiler/rustc_incremental/src/persist/dirty_clean.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ impl<'tcx> DirtyCleanVisitor<'tcx> {
302302
HirNode::ImplItem(item) => match item.kind {
303303
ImplItemKind::Fn(..) => ("Node::ImplItem", LABELS_FN_IN_IMPL),
304304
ImplItemKind::Const(..) => ("NodeImplConst", LABELS_CONST_IN_IMPL),
305-
ImplItemKind::TyAlias(..) => ("NodeImplType", LABELS_CONST_IN_IMPL),
305+
ImplItemKind::Type(..) => ("NodeImplType", LABELS_CONST_IN_IMPL),
306306
},
307307
_ => self.tcx.sess.span_fatal(
308308
attr.span,

compiler/rustc_infer/src/infer/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2570,7 +2570,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
25702570
for h in self.tcx.hir().parent_iter(param.hir_id) {
25712571
break 'origin match h.1 {
25722572
Node::ImplItem(hir::ImplItem {
2573-
kind: hir::ImplItemKind::TyAlias(..),
2573+
kind: hir::ImplItemKind::Type(..),
25742574
generics,
25752575
..
25762576
})

compiler/rustc_middle/src/hir/map/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl<'hir> Map<'hir> {
241241
Node::ImplItem(item) => match item.kind {
242242
ImplItemKind::Const(..) => DefKind::AssocConst,
243243
ImplItemKind::Fn(..) => DefKind::AssocFn,
244-
ImplItemKind::TyAlias(..) => DefKind::AssocTy,
244+
ImplItemKind::Type(..) => DefKind::AssocTy,
245245
},
246246
Node::Variant(_) => DefKind::Variant,
247247
Node::Ctor(variant_data) => {
@@ -1244,7 +1244,7 @@ fn hir_id_to_string(map: Map<'_>, id: HirId) -> String {
12441244
format!("assoc const {} in {}{}", ii.ident, path_str(), id_str)
12451245
}
12461246
ImplItemKind::Fn(..) => format!("method {} in {}{}", ii.ident, path_str(), id_str),
1247-
ImplItemKind::TyAlias(_) => {
1247+
ImplItemKind::Type(_) => {
12481248
format!("assoc type {} in {}{}", ii.ident, path_str(), id_str)
12491249
}
12501250
},

compiler/rustc_passes/src/check_attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub(crate) fn target_from_impl_item<'tcx>(
4949
Target::Method(MethodKind::Inherent)
5050
}
5151
}
52-
hir::ImplItemKind::TyAlias(..) => Target::AssocTy,
52+
hir::ImplItemKind::Type(..) => Target::AssocTy,
5353
}
5454
}
5555

compiler/rustc_passes/src/hir_stats.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> {
391391
fn visit_impl_item(&mut self, ii: &'v hir::ImplItem<'v>) {
392392
record_variants!(
393393
(self, ii, ii.kind, Id::Node(ii.hir_id()), hir, ImplItem, ImplItemKind),
394-
[Const, Fn, TyAlias]
394+
[Const, Fn, Type]
395395
);
396396
hir_visit::walk_impl_item(self, ii)
397397
}

compiler/rustc_passes/src/reachable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl<'tcx> ReachableContext<'tcx> {
155155
let impl_did = self.tcx.hir().get_parent_item(hir_id);
156156
method_might_be_inlined(self.tcx, impl_item, impl_did.def_id)
157157
}
158-
hir::ImplItemKind::TyAlias(_) => false,
158+
hir::ImplItemKind::Type(_) => false,
159159
},
160160
Some(_) => false,
161161
None => false, // This will happen for default methods.
@@ -271,7 +271,7 @@ impl<'tcx> ReachableContext<'tcx> {
271271
self.visit_nested_body(body)
272272
}
273273
}
274-
hir::ImplItemKind::TyAlias(_) => {}
274+
hir::ImplItemKind::Type(_) => {}
275275
},
276276
Node::Expr(&hir::Expr {
277277
kind: hir::ExprKind::Closure(&hir::Closure { body, .. }),

compiler/rustc_privacy/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
15741574
hir::ImplItemKind::Const(..) | hir::ImplItemKind::Fn(..) => {
15751575
self.access_levels.is_reachable(impl_item_ref.id.def_id.def_id)
15761576
}
1577-
hir::ImplItemKind::TyAlias(_) => false,
1577+
hir::ImplItemKind::Type(_) => false,
15781578
}
15791579
});
15801580

@@ -1596,7 +1596,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
15961596
{
15971597
intravisit::walk_impl_item(self, impl_item)
15981598
}
1599-
hir::ImplItemKind::TyAlias(..) => {
1599+
hir::ImplItemKind::Type(..) => {
16001600
intravisit::walk_impl_item(self, impl_item)
16011601
}
16021602
_ => {}
@@ -1622,7 +1622,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
16221622
// Those in 3. are warned with this call.
16231623
for impl_item_ref in impl_.items {
16241624
let impl_item = self.tcx.hir().impl_item(impl_item_ref.id);
1625-
if let hir::ImplItemKind::TyAlias(ty) = impl_item.kind {
1625+
if let hir::ImplItemKind::Type(ty) = impl_item.kind {
16261626
self.visit_ty(ty);
16271627
}
16281628
}

compiler/rustc_resolve/src/late/lifetimes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
898898
Fn(..) => self.visit_early_late(impl_item.hir_id(), &impl_item.generics, |this| {
899899
intravisit::walk_impl_item(this, impl_item)
900900
}),
901-
TyAlias(ref ty) => {
901+
Type(ref ty) => {
902902
let generics = &impl_item.generics;
903903
let lifetimes: FxIndexMap<LocalDefId, Region> = generics
904904
.params

compiler/rustc_save_analysis/src/dump_visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ impl<'tcx> DumpVisitor<'tcx> {
10691069
impl_item.span,
10701070
);
10711071
}
1072-
hir::ImplItemKind::TyAlias(ref ty) => {
1072+
hir::ImplItemKind::Type(ref ty) => {
10731073
// FIXME: uses of the assoc type should ideally point to this
10741074
// 'def' and the name here should be a ref to the def in the
10751075
// trait.

compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
16391639
..
16401640
})
16411641
| hir::Node::ImplItem(hir::ImplItem {
1642-
kind: hir::ImplItemKind::TyAlias(ty),
1642+
kind: hir::ImplItemKind::Type(ty),
16431643
..
16441644
}),
16451645
) => Some((ty.span, format!("type mismatch resolving `{}`", predicate))),

compiler/rustc_trait_selection/src/traits/wf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ fn extend_cause_with_original_assoc_item_obligation<'tcx>(
224224
};
225225
let fix_span =
226226
|impl_item_ref: &hir::ImplItemRef| match tcx.hir().impl_item(impl_item_ref.id).kind {
227-
hir::ImplItemKind::Const(ty, _) | hir::ImplItemKind::TyAlias(ty) => ty.span,
227+
hir::ImplItemKind::Const(ty, _) | hir::ImplItemKind::Type(ty) => ty.span,
228228
_ => impl_item_ref.span,
229229
};
230230

compiler/rustc_ty_utils/src/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
161161
}) => hir::Constness::Const,
162162

163163
hir::Node::ImplItem(hir::ImplItem {
164-
kind: hir::ImplItemKind::TyAlias(..) | hir::ImplItemKind::Fn(..),
164+
kind: hir::ImplItemKind::Type(..) | hir::ImplItemKind::Fn(..),
165165
..
166166
}) => {
167167
let parent_hir_id = tcx.hir().get_parent_node(hir_id);

src/librustdoc/clean/inline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ pub(crate) fn build_impl(
410410
let assoc_kind = match item.kind {
411411
hir::ImplItemKind::Const(..) => ty::AssocKind::Const,
412412
hir::ImplItemKind::Fn(..) => ty::AssocKind::Fn,
413-
hir::ImplItemKind::TyAlias(..) => ty::AssocKind::Type,
413+
hir::ImplItemKind::Type(..) => ty::AssocKind::Type,
414414
};
415415
let trait_item = tcx
416416
.associated_items(associated_trait.def_id)

src/librustdoc/clean/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ pub(crate) fn clean_impl_item<'tcx>(
10661066
let defaultness = cx.tcx.impl_defaultness(impl_.def_id);
10671067
MethodItem(m, Some(defaultness))
10681068
}
1069-
hir::ImplItemKind::TyAlias(hir_ty) => {
1069+
hir::ImplItemKind::Type(hir_ty) => {
10701070
let type_ = clean_ty(hir_ty, cx);
10711071
let generics = clean_generics(impl_.generics, cx);
10721072
let item_type = clean_middle_ty(hir_ty_to_ty(cx.tcx, hir_ty), cx, None);

src/tools/clippy/clippy_lints/src/missing_inline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingInline {
148148

149149
let desc = match impl_item.kind {
150150
hir::ImplItemKind::Fn(..) => "a method",
151-
hir::ImplItemKind::Const(..) | hir::ImplItemKind::TyAlias(_) => return,
151+
hir::ImplItemKind::Const(..) | hir::ImplItemKind::Type(_) => return,
152152
};
153153

154154
let assoc_item = cx.tcx.associated_item(impl_item.def_id);

src/tools/clippy/clippy_lints/src/types/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ impl<'tcx> LateLintPass<'tcx> for Types {
372372
// Methods are covered by check_fn.
373373
// Type aliases are ignored because oftentimes it's impossible to
374374
// make type alias declaration in trait simpler, see #1013
375-
ImplItemKind::Fn(..) | ImplItemKind::TyAlias(..) => (),
375+
ImplItemKind::Fn(..) | ImplItemKind::Type(..) => (),
376376
}
377377
}
378378

src/tools/clippy/clippy_utils/src/check_proc_macro.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ fn trait_item_search_pat(item: &TraitItem<'_>) -> (Pat, Pat) {
220220
fn impl_item_search_pat(item: &ImplItem<'_>) -> (Pat, Pat) {
221221
let (start_pat, end_pat) = match &item.kind {
222222
ImplItemKind::Const(..) => (Pat::Str("const"), Pat::Str(";")),
223-
ImplItemKind::TyAlias(..) => (Pat::Str("type"), Pat::Str(";")),
223+
ImplItemKind::Type(..) => (Pat::Str("type"), Pat::Str(";")),
224224
ImplItemKind::Fn(sig, ..) => (fn_header_search_pat(sig.header), Pat::Str("")),
225225
};
226226
if item.vis_span.is_empty() {

0 commit comments

Comments
 (0)