Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0b7d4fa

Browse files
committedMay 25, 2019
Rename "Associated*" to "Assoc*"
We are going to uniform the terminology of all associated items. Methods that may or may not have `self` are called "associated functions". Because `AssociatedFn` is a bit long, we rename `Associated` to `Assoc`.
1 parent d96c01e commit 0b7d4fa

Some content is hidden

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

62 files changed

+349
-349
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.

0 commit comments

Comments
 (0)
Please sign in to comment.