Skip to content

Commit d0209c4

Browse files
committed
Replace TyForeign with ForeignTy
1 parent 05cfb3f commit d0209c4

File tree

11 files changed

+14
-14
lines changed

11 files changed

+14
-14
lines changed

src/librustc/hir/def.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub enum Def {
5353
Existential(DefId),
5454
/// `type Foo = Bar;`
5555
TyAlias(DefId),
56-
TyForeign(DefId),
56+
ForeignTy(DefId),
5757
TraitAlias(DefId),
5858
AssociatedTy(DefId),
5959
/// `existential type Foo: Bar;`
@@ -272,7 +272,7 @@ impl Def {
272272
Def::AssociatedTy(id) | Def::TyParam(id) | Def::Struct(id) | Def::StructCtor(id, ..) |
273273
Def::Union(id) | Def::Trait(id) | Def::Method(id) | Def::Const(id) |
274274
Def::AssociatedConst(id) | Def::Macro(id, ..) |
275-
Def::Existential(id) | Def::AssociatedExistential(id) | Def::TyForeign(id) => {
275+
Def::Existential(id) | Def::AssociatedExistential(id) | Def::ForeignTy(id) => {
276276
id
277277
}
278278

@@ -311,7 +311,7 @@ impl Def {
311311
Def::StructCtor(.., CtorKind::Fictive) => bug!("impossible struct constructor"),
312312
Def::Union(..) => "union",
313313
Def::Trait(..) => "trait",
314-
Def::TyForeign(..) => "foreign type",
314+
Def::ForeignTy(..) => "foreign type",
315315
Def::Method(..) => "method",
316316
Def::Const(..) => "constant",
317317
Def::AssociatedConst(..) => "associated constant",

src/librustc/hir/map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ impl<'hir> Map<'hir> {
453453
match item.node {
454454
ForeignItemKind::Fn(..) => Some(Def::Fn(def_id)),
455455
ForeignItemKind::Static(_, m) => Some(Def::Static(def_id, m)),
456-
ForeignItemKind::Type => Some(Def::TyForeign(def_id)),
456+
ForeignItemKind::Type => Some(Def::ForeignTy(def_id)),
457457
}
458458
}
459459
NodeTraitItem(item) => {

src/librustc/ich/impls_hir.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ impl_stable_hash_for!(enum hir::def::Def {
10121012
PrimTy(prim_ty),
10131013
TyParam(def_id),
10141014
SelfTy(trait_def_id, impl_def_id),
1015-
TyForeign(def_id),
1015+
ForeignTy(def_id),
10161016
Fn(def_id),
10171017
Const(def_id),
10181018
Static(def_id, is_mutbl),

src/librustc_metadata/decoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ impl<'tcx> EntryKind<'tcx> {
429429
EntryKind::Trait(_) => Def::Trait(did),
430430
EntryKind::Enum(..) => Def::Enum(did),
431431
EntryKind::MacroDef(_) => Def::Macro(did, MacroKind::Bang),
432-
EntryKind::ForeignType => Def::TyForeign(did),
432+
EntryKind::ForeignType => Def::ForeignTy(did),
433433

434434
EntryKind::ForeignMod |
435435
EntryKind::GlobalAsm |

src/librustc_resolve/build_reduced_graph.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
656656
(Def::Static(self.definitions.local_def_id(item.id), m), ValueNS)
657657
}
658658
ForeignItemKind::Ty => {
659-
(Def::TyForeign(self.definitions.local_def_id(item.id)), TypeNS)
659+
(Def::ForeignTy(self.definitions.local_def_id(item.id)), TypeNS)
660660
}
661661
ForeignItemKind::Macro(_) => unreachable!(),
662662
};
@@ -692,7 +692,7 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
692692
span);
693693
self.define(parent, ident, TypeNS, (module, vis, DUMMY_SP, expansion));
694694
}
695-
Def::Variant(..) | Def::TyAlias(..) | Def::TyForeign(..) => {
695+
Def::Variant(..) | Def::TyAlias(..) | Def::ForeignTy(..) => {
696696
self.define(parent, ident, TypeNS, (def, vis, DUMMY_SP, expansion));
697697
}
698698
Def::Fn(..) | Def::Static(..) | Def::Const(..) | Def::VariantCtor(..) => {

src/librustc_resolve/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ impl<'a> PathSource<'a> {
539539
Def::Trait(..) | Def::TyAlias(..) | Def::AssociatedTy(..) |
540540
Def::PrimTy(..) | Def::TyParam(..) | Def::SelfTy(..) |
541541
Def::Existential(..) |
542-
Def::TyForeign(..) => true,
542+
Def::ForeignTy(..) => true,
543543
_ => false,
544544
},
545545
PathSource::Trait(AliasPossibility::No) => match def {

src/librustc_save_analysis/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
747747
HirDef::Union(def_id) |
748748
HirDef::Enum(def_id) |
749749
HirDef::TyAlias(def_id) |
750-
HirDef::TyForeign(def_id) |
750+
HirDef::ForeignTy(def_id) |
751751
HirDef::TraitAlias(def_id) |
752752
HirDef::AssociatedExistential(def_id) |
753753
HirDef::AssociatedTy(def_id) |

src/librustc_typeck/astconv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
13871387
)
13881388
}
13891389
Def::Enum(did) | Def::TyAlias(did) | Def::Struct(did) |
1390-
Def::Union(did) | Def::TyForeign(did) => {
1390+
Def::Union(did) | Def::ForeignTy(did) => {
13911391
assert_eq!(opt_self_ty, None);
13921392
self.prohibit_generics(path.segments.split_last().unwrap().1);
13931393
self.ast_path_to_ty(span, did, path.segments.last().unwrap())

src/librustdoc/clean/inline.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub fn try_inline(cx: &DocContext, def: Def, name: ast::Name, visited: &mut FxHa
8383
ret.extend(build_impls(cx, did, true));
8484
clean::EnumItem(build_enum(cx, did))
8585
}
86-
Def::TyForeign(did) => {
86+
Def::ForeignTy(did) => {
8787
record_extern_fqn(cx, did, clean::TypeKind::Foreign);
8888
ret.extend(build_impls(cx, did, false));
8989
clean::ForeignTypeItem

src/librustdoc/clean/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3731,7 +3731,7 @@ pub fn register_def(cx: &DocContext, def: Def) -> DefId {
37313731
Def::Struct(i) => (i, TypeKind::Struct),
37323732
Def::Union(i) => (i, TypeKind::Union),
37333733
Def::Mod(i) => (i, TypeKind::Module),
3734-
Def::TyForeign(i) => (i, TypeKind::Foreign),
3734+
Def::ForeignTy(i) => (i, TypeKind::Foreign),
37353735
Def::Const(i) => (i, TypeKind::Const),
37363736
Def::Static(i, _) => (i, TypeKind::Static),
37373737
Def::Variant(i) => (cx.tcx.parent_def_id(i).expect("cannot get parent def id"),

src/librustdoc/visit_ast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ impl<'a, 'tcx, 'rcx, 'cstore> RustdocVisitor<'a, 'tcx, 'rcx, 'cstore> {
267267
Def::Struct(did) |
268268
Def::Union(did) |
269269
Def::Enum(did) |
270-
Def::TyForeign(did) |
270+
Def::ForeignTy(did) |
271271
Def::TyAlias(did) if !self_is_hidden => {
272272
self.cx.access_levels.borrow_mut().map.insert(did, AccessLevel::Public);
273273
},

0 commit comments

Comments
 (0)