diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-05-06 16:37:32 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-07-16 20:01:52 -0700 |
| commit | 357d5cd96caea4fbccb989dc4bf5eed71c785c1c (patch) | |
| tree | 444078402829e231abcbef1ab2a6d30af1ac819e /src/libsyntax/print | |
| parent | 459ffc2adc74f5e8b64a76f5670edb419b9f65da (diff) | |
| download | rust-357d5cd96caea4fbccb989dc4bf5eed71c785c1c.tar.gz rust-357d5cd96caea4fbccb989dc4bf5eed71c785c1c.zip | |
librustc: Implement the fully-expanded, UFCS form of explicit self.
This makes two changes to region inference: (1) it allows region inference to relate early-bound regions; and (2) it allows regions to be related before variance runs. The former is needed because there is no relation between the two regions before region substitution happens, while the latter is needed because type collection has to run before variance. We assume that, before variance is inferred, that lifetimes are invariant. This is a conservative overapproximation. This relates to #13885. This does not remove `~self` from the language yet, however. [breaking-change]
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index d524622f8ec..428a15cb8cf 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1859,6 +1859,11 @@ impl<'a> State<'a> { try!(self.print_mutability(m)); try!(word(&mut self.s, "self")); } + ast::SelfExplicit(ref typ, _) => { + try!(word(&mut self.s, "self")); + try!(self.word_space(":")); + try!(self.print_type(*typ)); + } } return Ok(true); } |
