diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-01-13 20:30:23 -0800 |
|---|---|---|
| committer | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-01-19 23:41:42 -0800 |
| commit | 01cbe506f99aa484f583a7affb65d15a839d2412 (patch) | |
| tree | 8d1a9404220d39f619e7d8dd50f05fc0dd3ce992 /src/libsyntax | |
| parent | 29b854fb741809c29764e33fc17c32ba9c6523ba (diff) | |
| download | rust-01cbe506f99aa484f583a7affb65d15a839d2412.tar.gz rust-01cbe506f99aa484f583a7affb65d15a839d2412.zip | |
Add `constness` field to `ast::ItemKind::Impl`
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/mut_visit.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 9 | ||||
| -rw-r--r-- | src/libsyntax/visit.rs | 1 |
4 files changed, 12 insertions, 0 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index a5a4eb1583b..6b54893075e 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -2618,6 +2618,7 @@ pub enum ItemKind { unsafety: Unsafety, polarity: ImplPolarity, defaultness: Defaultness, + constness: Constness, generics: Generics, /// The trait being implemented, if any. diff --git a/src/libsyntax/mut_visit.rs b/src/libsyntax/mut_visit.rs index 750d054e8a0..8f82ff6b040 100644 --- a/src/libsyntax/mut_visit.rs +++ b/src/libsyntax/mut_visit.rs @@ -922,6 +922,7 @@ pub fn noop_visit_item_kind<T: MutVisitor>(kind: &mut ItemKind, vis: &mut T) { unsafety: _, polarity: _, defaultness: _, + constness: _, generics, of_trait, self_ty, diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index bc67980c454..3927e4f9030 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1230,6 +1230,7 @@ impl<'a> State<'a> { unsafety, polarity, defaultness, + constness, ref generics, ref of_trait, ref self_ty, @@ -1240,6 +1241,7 @@ impl<'a> State<'a> { self.print_defaultness(defaultness); self.print_unsafety(unsafety); self.word_nbsp("impl"); + self.print_constness(constness); if !generics.params.is_empty() { self.print_generic_params(&generics.params); @@ -2773,6 +2775,13 @@ impl<'a> State<'a> { } } + crate fn print_constness(&mut self, s: ast::Constness) { + match s { + ast::Constness::Const => self.word_nbsp("const"), + ast::Constness::NotConst => {} + } + } + crate fn print_is_auto(&mut self, s: ast::IsAuto) { match s { ast::IsAuto::Yes => self.word_nbsp("auto"), diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index d03a9dfc167..946a0d29cd3 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -312,6 +312,7 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) { unsafety: _, polarity: _, defaultness: _, + constness: _, ref generics, ref of_trait, ref self_ty, |
