about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-12-11 12:56:22 -0800
committerbors <bors@rust-lang.org>2013-12-11 12:56:22 -0800
commit1b12dca7f97a51c6cbb4f47ea6e095d841a97c1a (patch)
tree19f1a66a4ced0e180c4fa1720ecfe53b14e92465 /src/libsyntax/parse
parent47d10c745ebcc31768e98083c8c6d5396f4edcdb (diff)
parent5731ca3078318a66a13208133d8839a9f9f92629 (diff)
downloadrust-1b12dca7f97a51c6cbb4f47ea6e095d841a97c1a.tar.gz
rust-1b12dca7f97a51c6cbb4f47ea6e095d841a97c1a.zip
auto merge of #10897 : boredomist/rust/remove-self-lifetime, r=brson
Also remove all instances of 'self within the codebase.

This fixes #10889.

To make reviewing easier the following files were modified with more than a dumb text replacement:

- `src/test/compile-fail/lifetime-no-keyword.rs`
- `src/test/compile-fail/lifetime-obsoleted-self.rs`
- `src/test/compile-fail/regions-free-region-ordering-incorrect.rs`
- `src/libsyntax/parse/lexer.rs`
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/lexer.rs13
-rw-r--r--src/libsyntax/parse/parser.rs6
2 files changed, 10 insertions, 9 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index 22a999ab744..d48c1d9d8d7 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -764,14 +764,15 @@ fn next_token_inner(rdr: @mut StringReader) -> token::Token {
                 let ident = str_to_ident(lifetime_name);
                 let tok = &token::IDENT(ident, false);
 
-                if token::is_any_keyword(tok)
-                    && !token::is_keyword(token::keywords::Static, tok)
-                    && !token::is_keyword(token::keywords::Self, tok) {
+                if token::is_keyword(token::keywords::Self, tok) {
                     fatal_span(rdr, start, rdr.last_pos,
-                        ~"invalid lifetime name");
+                               ~"invalid lifetime name: 'self is no longer a special lifetime");
+                } else if token::is_any_keyword(tok) &&
+                    !token::is_keyword(token::keywords::Static, tok) {
+                    fatal_span(rdr, start, rdr.last_pos, ~"invalid lifetime name");
+                } else {
+                    token::LIFETIME(ident)
                 }
-
-                token::LIFETIME(ident)
             })
         }
 
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 4270a4d0dc5..aa37d859d79 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -102,13 +102,13 @@ pub enum PathParsingMode {
     /// A path with no type parameters; e.g. `foo::bar::Baz`
     NoTypesAllowed,
     /// A path with a lifetime and type parameters, with no double colons
-    /// before the type parameters; e.g. `foo::bar<'self>::Baz<T>`
+    /// before the type parameters; e.g. `foo::bar<'a>::Baz<T>`
     LifetimeAndTypesWithoutColons,
     /// A path with a lifetime and type parameters with double colons before
-    /// the type parameters; e.g. `foo::bar::<'self>::Baz::<T>`
+    /// the type parameters; e.g. `foo::bar::<'a>::Baz::<T>`
     LifetimeAndTypesWithColons,
     /// A path with a lifetime and type parameters with bounds before the last
-    /// set of type parameters only; e.g. `foo::bar<'self>::Baz:X+Y<T>` This
+    /// set of type parameters only; e.g. `foo::bar<'a>::Baz:X+Y<T>` This
     /// form does not use extra double colons.
     LifetimeAndTypesAndBounds,
 }