diff options
| author | Flavio Percoco <flaper87@gmail.com> | 2014-12-28 23:33:18 +0100 |
|---|---|---|
| committer | Flavio Percoco <flaper87@gmail.com> | 2015-01-04 23:16:13 +0100 |
| commit | 8b883ab2681e34ef94575f45c6c0e6c2bca23ab7 (patch) | |
| tree | 899739abf4baa17ccbc570add56eca1987d030f9 /src/libsyntax/print | |
| parent | 470118f3e915cdc8f936aca0640b28a7a3d8dc6c (diff) | |
| download | rust-8b883ab2681e34ef94575f45c6c0e6c2bca23ab7.tar.gz rust-8b883ab2681e34ef94575f45c6c0e6c2bca23ab7.zip | |
Add syntax for negative implementations of traits
This commit introduces the syntax for negative implmenetations of traits
as shown below:
`impl !Trait for Type {}`
cc #13231
Part of RFC #3
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 9702c79719c..61b7aa408a8 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -917,6 +917,7 @@ impl<'a> State<'a> { } ast::ItemImpl(unsafety, + polarity, ref generics, ref opt_trait, ref ty, @@ -931,6 +932,13 @@ impl<'a> State<'a> { try!(space(&mut self.s)); } + match polarity { + ast::ImplPolarity::Negative => { + try!(word(&mut self.s, "!")); + }, + _ => {} + } + match opt_trait { &Some(ref t) => { try!(self.print_trait_ref(t)); |
