From 357d5cd96caea4fbccb989dc4bf5eed71c785c1c Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 6 May 2014 16:37:32 -0700 Subject: 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] --- src/libsyntax/print/pprust.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/libsyntax/print/pprust.rs') 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); } -- cgit 1.4.1-3-g733a5