Skip to content

Commit 837b72c

Browse files
committed
Auto merge of #60955 - agnxy:rename-assoc, r=oli-obk,Centril
Rename "Associated*" to "Assoc*" This change is for #60163. r? @oli-obk
2 parents 87ed0b4 + c963596 commit 837b72c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+350
-350
lines changed

src/librustc/hir/def.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ pub enum DefKind {
6161
TyAlias,
6262
ForeignTy,
6363
TraitAlias,
64-
AssociatedTy,
64+
AssocTy,
6565
/// `existential type Foo: Bar;`
66-
AssociatedExistential,
66+
AssocExistential,
6767
TyParam,
6868

6969
// Value namespace
@@ -74,7 +74,7 @@ pub enum DefKind {
7474
/// Refers to the struct or enum variant's constructor.
7575
Ctor(CtorOf, CtorKind),
7676
Method,
77-
AssociatedConst,
77+
AssocConst,
7878

7979
// Macro namespace
8080
Macro(MacroKind),
@@ -99,14 +99,14 @@ impl DefKind {
9999
DefKind::Existential => "existential type",
100100
DefKind::TyAlias => "type alias",
101101
DefKind::TraitAlias => "trait alias",
102-
DefKind::AssociatedTy => "associated type",
103-
DefKind::AssociatedExistential => "associated existential type",
102+
DefKind::AssocTy => "associated type",
103+
DefKind::AssocExistential => "associated existential type",
104104
DefKind::Union => "union",
105105
DefKind::Trait => "trait",
106106
DefKind::ForeignTy => "foreign type",
107107
DefKind::Method => "method",
108108
DefKind::Const => "constant",
109-
DefKind::AssociatedConst => "associated constant",
109+
DefKind::AssocConst => "associated constant",
110110
DefKind::TyParam => "type parameter",
111111
DefKind::ConstParam => "const parameter",
112112
DefKind::Macro(macro_kind) => macro_kind.descr(),
@@ -116,9 +116,9 @@ impl DefKind {
116116
/// An English article for the def.
117117
pub fn article(&self) -> &'static str {
118118
match *self {
119-
DefKind::AssociatedTy
120-
| DefKind::AssociatedConst
121-
| DefKind::AssociatedExistential
119+
DefKind::AssocTy
120+
| DefKind::AssocConst
121+
| DefKind::AssocExistential
122122
| DefKind::Enum
123123
| DefKind::Existential => "an",
124124
DefKind::Macro(macro_kind) => macro_kind.article(),

src/librustc/hir/intravisit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ pub trait Visitor<'v> : Sized {
370370
fn visit_vis(&mut self, vis: &'v Visibility) {
371371
walk_vis(self, vis)
372372
}
373-
fn visit_associated_item_kind(&mut self, kind: &'v AssociatedItemKind) {
373+
fn visit_associated_item_kind(&mut self, kind: &'v AssocItemKind) {
374374
walk_associated_item_kind(self, kind);
375375
}
376376
fn visit_defaultness(&mut self, defaultness: &'v Defaultness) {
@@ -1120,7 +1120,7 @@ pub fn walk_vis<'v, V: Visitor<'v>>(visitor: &mut V, vis: &'v Visibility) {
11201120
}
11211121
}
11221122

1123-
pub fn walk_associated_item_kind<'v, V: Visitor<'v>>(_: &mut V, _: &'v AssociatedItemKind) {
1123+
pub fn walk_associated_item_kind<'v, V: Visitor<'v>>(_: &mut V, _: &'v AssocItemKind) {
11241124
// No visitable content here: this fn exists so you can call it if
11251125
// the right thing to do, should content be added in the future,
11261126
// would be to walk it.

src/librustc/hir/lowering.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,7 +1860,7 @@ impl<'a> LoweringContext<'a> {
18601860
index: this.def_key(def_id).parent.expect("missing parent"),
18611861
};
18621862
let type_def_id = match partial_res.base_res() {
1863-
Res::Def(DefKind::AssociatedTy, def_id) if i + 2 == proj_start => {
1863+
Res::Def(DefKind::AssocTy, def_id) if i + 2 == proj_start => {
18641864
Some(parent_def_id(self, def_id))
18651865
}
18661866
Res::Def(DefKind::Variant, def_id) if i + 1 == proj_start => {
@@ -1882,8 +1882,8 @@ impl<'a> LoweringContext<'a> {
18821882
if i + 1 == proj_start => ParenthesizedGenericArgs::Ok,
18831883
// `a::b::Trait(Args)::TraitItem`
18841884
Res::Def(DefKind::Method, _)
1885-
| Res::Def(DefKind::AssociatedConst, _)
1886-
| Res::Def(DefKind::AssociatedTy, _)
1885+
| Res::Def(DefKind::AssocConst, _)
1886+
| Res::Def(DefKind::AssocTy, _)
18871887
if i + 2 == proj_start =>
18881888
{
18891889
ParenthesizedGenericArgs::Ok
@@ -3589,13 +3589,13 @@ impl<'a> LoweringContext<'a> {
35893589
fn lower_trait_item_ref(&mut self, i: &TraitItem) -> hir::TraitItemRef {
35903590
let (kind, has_default) = match i.node {
35913591
TraitItemKind::Const(_, ref default) => {
3592-
(hir::AssociatedItemKind::Const, default.is_some())
3592+
(hir::AssocItemKind::Const, default.is_some())
35933593
}
35943594
TraitItemKind::Type(_, ref default) => {
3595-
(hir::AssociatedItemKind::Type, default.is_some())
3595+
(hir::AssocItemKind::Type, default.is_some())
35963596
}
35973597
TraitItemKind::Method(ref sig, ref default) => (
3598-
hir::AssociatedItemKind::Method {
3598+
hir::AssocItemKind::Method {
35993599
has_self: sig.decl.has_self(),
36003600
},
36013601
default.is_some(),
@@ -3695,10 +3695,10 @@ impl<'a> LoweringContext<'a> {
36953695
vis: self.lower_visibility(&i.vis, Some(i.id)),
36963696
defaultness: self.lower_defaultness(i.defaultness, true /* [1] */),
36973697
kind: match i.node {
3698-
ImplItemKind::Const(..) => hir::AssociatedItemKind::Const,
3699-
ImplItemKind::Type(..) => hir::AssociatedItemKind::Type,
3700-
ImplItemKind::Existential(..) => hir::AssociatedItemKind::Existential,
3701-
ImplItemKind::Method(ref sig, _) => hir::AssociatedItemKind::Method {
3698+
ImplItemKind::Const(..) => hir::AssocItemKind::Const,
3699+
ImplItemKind::Type(..) => hir::AssocItemKind::Type,
3700+
ImplItemKind::Existential(..) => hir::AssocItemKind::Existential,
3701+
ImplItemKind::Method(ref sig, _) => hir::AssocItemKind::Method {
37023702
has_self: sig.decl.has_self(),
37033703
},
37043704
ImplItemKind::Macro(..) => unimplemented!(),

src/librustc/hir/map/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,17 +337,17 @@ impl<'hir> Map<'hir> {
337337
}
338338
Node::TraitItem(item) => {
339339
match item.node {
340-
TraitItemKind::Const(..) => DefKind::AssociatedConst,
340+
TraitItemKind::Const(..) => DefKind::AssocConst,
341341
TraitItemKind::Method(..) => DefKind::Method,
342-
TraitItemKind::Type(..) => DefKind::AssociatedTy,
342+
TraitItemKind::Type(..) => DefKind::AssocTy,
343343
}
344344
}
345345
Node::ImplItem(item) => {
346346
match item.node {
347-
ImplItemKind::Const(..) => DefKind::AssociatedConst,
347+
ImplItemKind::Const(..) => DefKind::AssocConst,
348348
ImplItemKind::Method(..) => DefKind::Method,
349-
ImplItemKind::Type(..) => DefKind::AssociatedTy,
350-
ImplItemKind::Existential(..) => DefKind::AssociatedExistential,
349+
ImplItemKind::Type(..) => DefKind::AssocTy,
350+
ImplItemKind::Existential(..) => DefKind::AssocExistential,
351351
}
352352
}
353353
Node::Variant(_) => DefKind::Variant,

src/librustc/hir/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2422,7 +2422,7 @@ pub struct TraitItemRef {
24222422
pub id: TraitItemId,
24232423
#[stable_hasher(project(name))]
24242424
pub ident: Ident,
2425-
pub kind: AssociatedItemKind,
2425+
pub kind: AssocItemKind,
24262426
pub span: Span,
24272427
pub defaultness: Defaultness,
24282428
}
@@ -2438,14 +2438,14 @@ pub struct ImplItemRef {
24382438
pub id: ImplItemId,
24392439
#[stable_hasher(project(name))]
24402440
pub ident: Ident,
2441-
pub kind: AssociatedItemKind,
2441+
pub kind: AssocItemKind,
24422442
pub span: Span,
24432443
pub vis: Visibility,
24442444
pub defaultness: Defaultness,
24452445
}
24462446

24472447
#[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable)]
2448-
pub enum AssociatedItemKind {
2448+
pub enum AssocItemKind {
24492449
Const,
24502450
Method { has_self: bool },
24512451
Type,

src/librustc/middle/dead.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
7272
fn handle_res(&mut self, res: Res) {
7373
match res {
7474
Res::Def(DefKind::Const, _)
75-
| Res::Def(DefKind::AssociatedConst, _)
75+
| Res::Def(DefKind::AssocConst, _)
7676
| Res::Def(DefKind::TyAlias, _) => {
7777
self.check_def_id(res.def_id());
7878
}

src/librustc/middle/expr_use_visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
909909
| Res::Def(DefKind::Ctor(..), _)
910910
| Res::Def(DefKind::Union, _)
911911
| Res::Def(DefKind::TyAlias, _)
912-
| Res::Def(DefKind::AssociatedTy, _)
912+
| Res::Def(DefKind::AssocTy, _)
913913
| Res::SelfTy(..) => {
914914
debug!("struct cmt_pat={:?} pat={:?}", cmt_pat, pat);
915915
delegate.matched_pat(pat, &cmt_pat, match_mode);

src/librustc/middle/mem_categorization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
703703
Res::Def(DefKind::Ctor(..), _)
704704
| Res::Def(DefKind::Const, _)
705705
| Res::Def(DefKind::ConstParam, _)
706-
| Res::Def(DefKind::AssociatedConst, _)
706+
| Res::Def(DefKind::AssocConst, _)
707707
| Res::Def(DefKind::Fn, _)
708708
| Res::Def(DefKind::Method, _)
709709
| Res::SelfCtor(..) => {

src/librustc/middle/reachable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ReachableContext<'a, 'tcx> {
118118
// If this path leads to a constant, then we need to
119119
// recurse into the constant to continue finding
120120
// items that are reachable.
121-
Res::Def(DefKind::Const, _) | Res::Def(DefKind::AssociatedConst, _) => {
121+
Res::Def(DefKind::Const, _) | Res::Def(DefKind::AssocConst, _) => {
122122
self.worklist.push(hir_id);
123123
}
124124

src/librustc/middle/resolve_lifetime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,7 +1924,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
19241924
}
19251925
};
19261926
let type_def_id = match res {
1927-
Res::Def(DefKind::AssociatedTy, def_id)
1927+
Res::Def(DefKind::AssocTy, def_id)
19281928
if depth == 1 => Some(parent_def_id(self, def_id)),
19291929
Res::Def(DefKind::Variant, def_id)
19301930
if depth == 0 => Some(parent_def_id(self, def_id)),
@@ -2112,7 +2112,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
21122112
};
21132113

21142114
let has_self = match assoc_item_kind {
2115-
Some(hir::AssociatedItemKind::Method { has_self }) => has_self,
2115+
Some(hir::AssocItemKind::Method { has_self }) => has_self,
21162116
_ => false,
21172117
};
21182118

0 commit comments

Comments
 (0)