about summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2016-04-16 18:05:06 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2016-04-24 20:59:44 +0300
commite2c821d35ee5cb5211f92480a53b409b2b2c359e (patch)
treef4abbb16e9b02d26998e05a3566402f92233c852 /src/libsyntax_ext
parent546c052d225d41cd31f610e87a20f15cd0fa8e3c (diff)
downloadrust-e2c821d35ee5cb5211f92480a53b409b2b2c359e.tar.gz
rust-e2c821d35ee5cb5211f92480a53b409b2b2c359e.zip
syntax: Make static/super/self/Self keywords + special ident cleanup
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/deriving/generic/mod.rs6
-rw-r--r--src/libsyntax_ext/deriving/generic/ty.rs6
-rw-r--r--src/libsyntax_ext/format.rs4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs
index b8ba1a58f21..b117b383120 100644
--- a/src/libsyntax_ext/deriving/generic/mod.rs
+++ b/src/libsyntax_ext/deriving/generic/mod.rs
@@ -202,7 +202,7 @@ use syntax::codemap::Span;
 use syntax::errors::Handler;
 use syntax::util::move_map::MoveMap;
 use syntax::parse::token::{intern, InternedString};
-use syntax::parse::token::special_idents;
+use syntax::parse::token::{keywords, special_idents};
 use syntax::ptr::P;
 
 use self::ty::{LifetimeBounds, Path, Ptr, PtrTy, Self_, Ty};
@@ -635,7 +635,7 @@ impl<'a> TraitDef<'a> {
 
         cx.item(
             self.span,
-            special_idents::invalid,
+            special_idents::Invalid,
             a,
             ast::ItemKind::Impl(unsafety,
                                 ast::ImplPolarity::Positive,
@@ -866,7 +866,7 @@ impl<'a> MethodDef<'a> {
             // creating fresh self id
             _ => Some(ast::Arg::new_self(trait_.span,
                                          ast::Mutability::Immutable,
-                                         special_idents::self_))
+                                         keywords::SelfValue.ident))
         };
         let args = {
             let args = arg_types.into_iter().map(|(name, ty)| {
diff --git a/src/libsyntax_ext/deriving/generic/ty.rs b/src/libsyntax_ext/deriving/generic/ty.rs
index a924cc06953..972983c2538 100644
--- a/src/libsyntax_ext/deriving/generic/ty.rs
+++ b/src/libsyntax_ext/deriving/generic/ty.rs
@@ -19,7 +19,7 @@ use syntax::ast::{Expr,Generics,Ident};
 use syntax::ext::base::ExtCtxt;
 use syntax::ext::build::AstBuilder;
 use syntax::codemap::{Span,respan};
-use syntax::parse::token::special_idents;
+use syntax::parse::token::keywords;
 use syntax::ptr::P;
 
 /// The types of pointers
@@ -264,7 +264,7 @@ pub fn get_explicit_self(cx: &ExtCtxt, span: Span, self_ptr: &Option<PtrTy>)
     let self_path = cx.expr_self(span);
     match *self_ptr {
         None => {
-            (self_path, respan(span, ast::SelfKind::Value(special_idents::self_)))
+            (self_path, respan(span, ast::SelfKind::Value(keywords::SelfValue.ident)))
         }
         Some(ref ptr) => {
             let self_ty = respan(
@@ -272,7 +272,7 @@ pub fn get_explicit_self(cx: &ExtCtxt, span: Span, self_ptr: &Option<PtrTy>)
                 match *ptr {
                     Borrowed(ref lt, mutbl) => {
                         let lt = lt.map(|s| cx.lifetime(span, cx.ident_of(s).name));
-                        ast::SelfKind::Region(lt, mutbl, special_idents::self_)
+                        ast::SelfKind::Region(lt, mutbl, keywords::SelfValue.ident)
                     }
                     Raw(_) => cx.span_bug(span, "attempted to use *self in deriving definition")
                 });
diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs
index c8341a057a1..828f4a72e1f 100644
--- a/src/libsyntax_ext/format.rs
+++ b/src/libsyntax_ext/format.rs
@@ -449,7 +449,7 @@ impl<'a, 'b> Context<'a, 'b> {
         let sp = piece_ty.span;
         let ty = ecx.ty_rptr(sp,
             ecx.ty(sp, ast::TyKind::Vec(piece_ty)),
-            Some(ecx.lifetime(sp, special_idents::static_lifetime.name)),
+            Some(ecx.lifetime(sp, special_idents::StaticLifetime.name)),
             ast::Mutability::Immutable);
         let slice = ecx.expr_vec_slice(sp, pieces);
         // static instead of const to speed up codegen by not requiring this to be inlined
@@ -475,7 +475,7 @@ impl<'a, 'b> Context<'a, 'b> {
 
         // First, build up the static array which will become our precompiled
         // format "string"
-        let static_lifetime = self.ecx.lifetime(self.fmtsp, special_idents::static_lifetime.name);
+        let static_lifetime = self.ecx.lifetime(self.fmtsp, special_idents::StaticLifetime.name);
         let piece_ty = self.ecx.ty_rptr(
                 self.fmtsp,
                 self.ecx.ty_ident(self.fmtsp, self.ecx.ident_of("str")),