diff options
| author | Joseph Dunne <jd@lambda.tech> | 2016-06-11 02:00:07 +0100 |
|---|---|---|
| committer | Joseph Dunne <jd@lambda.tech> | 2016-06-13 21:46:43 +0100 |
| commit | dc3d878e0f513bde3dfad69d4f2722e2884c23a3 (patch) | |
| tree | 2d015d97944935b40d40b919debbb95b5176efc5 /src/libsyntax/print/pprust.rs | |
| parent | 0740a93cc290a5419807d2e8c6c442354baf46b0 (diff) | |
| download | rust-dc3d878e0f513bde3dfad69d4f2722e2884c23a3.tar.gz rust-dc3d878e0f513bde3dfad69d4f2722e2884c23a3.zip | |
Add support for macro expansion inside trait items
Diffstat (limited to 'src/libsyntax/print/pprust.rs')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 5b9ec924de9..7e9cc3763bf 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1549,6 +1549,17 @@ impl<'a> State<'a> { self.print_associated_type(ti.ident, Some(bounds), default.as_ref().map(|ty| &**ty))?; } + ast::TraitItemKind::Macro(codemap::Spanned { ref node, .. }) => { + // code copied from ItemKind::Mac: + self.print_path(&node.path, false, 0)?; + word(&mut self.s, "! ")?; + self.cbox(INDENT_UNIT)?; + self.popen()?; + self.print_tts(&node.tts[..])?; + self.pclose()?; + word(&mut self.s, ";")?; + self.end()? + } } self.ann.post(self, NodeSubItem(ti.id)) } |
