diff options
| author | bors <bors@rust-lang.org> | 2015-02-14 17:01:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-14 17:01:11 +0000 |
| commit | b63cee4a11fcfecf20ed8419bc3bd6859e6496bc (patch) | |
| tree | e614f946a2e7811fe886a52ee19899a4ede35dd9 /src/libsyntax/ext | |
| parent | 3d1c1added595c1c3410a1b72d8f0134942e4e24 (diff) | |
| parent | 07d00deab22dc07ffc58b8e74d45596242ca8b15 (diff) | |
| download | rust-b63cee4a11fcfecf20ed8419bc3bd6859e6496bc.tar.gz rust-b63cee4a11fcfecf20ed8419bc3bd6859e6496bc.zip | |
Auto merge of #22158 - Kimundi:the_lonely_uppercase_keyword, r=pnkfelix
It is only allowed in paths now, where it will either work inside a `trait` or `impl` item, or not resolve outside of it. [breaking-change] Closes #22137
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/deriving/clone.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/decodable.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/default.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/generic/mod.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/generic/ty.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/primitive.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/rand.rs | 2 |
7 files changed, 14 insertions, 14 deletions
diff --git a/src/libsyntax/ext/deriving/clone.rs b/src/libsyntax/ext/deriving/clone.rs index 9f009ad4d78..518fbcc80ee 100644 --- a/src/libsyntax/ext/deriving/clone.rs +++ b/src/libsyntax/ext/deriving/clone.rs @@ -38,7 +38,7 @@ pub fn expand_deriving_clone<F>(cx: &mut ExtCtxt, generics: LifetimeBounds::empty(), explicit_self: borrowed_explicit_self(), args: Vec::new(), - ret_ty: Self, + ret_ty: Self_, attributes: attrs, combine_substructure: combine_substructure(box |c, s, sub| { cs_clone("Clone", c, s, sub) diff --git a/src/libsyntax/ext/deriving/decodable.rs b/src/libsyntax/ext/deriving/decodable.rs index f003a3453e1..ab0f64e823f 100644 --- a/src/libsyntax/ext/deriving/decodable.rs +++ b/src/libsyntax/ext/deriving/decodable.rs @@ -76,7 +76,7 @@ fn expand_deriving_decodable_imp<F>(cx: &mut ExtCtxt, ret_ty: Literal(Path::new_( pathvec_std!(cx, core::result::Result), None, - vec!(box Self, box Literal(Path::new_( + vec!(box Self_, box Literal(Path::new_( vec!["__D", "Error"], None, vec![], false ))), true diff --git a/src/libsyntax/ext/deriving/default.rs b/src/libsyntax/ext/deriving/default.rs index 9b76f4b1658..c10975a2d32 100644 --- a/src/libsyntax/ext/deriving/default.rs +++ b/src/libsyntax/ext/deriving/default.rs @@ -38,7 +38,7 @@ pub fn expand_deriving_default<F>(cx: &mut ExtCtxt, generics: LifetimeBounds::empty(), explicit_self: None, args: Vec::new(), - ret_ty: Self, + ret_ty: Self_, attributes: attrs, combine_substructure: combine_substructure(box |a, b, c| { default_substructure(a, b, c) diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs index d9242417e04..f878cb5ca8b 100644 --- a/src/libsyntax/ext/deriving/generic/mod.rs +++ b/src/libsyntax/ext/deriving/generic/mod.rs @@ -207,7 +207,7 @@ use parse::token::InternedString; use parse::token::special_idents; use ptr::P; -use self::ty::{LifetimeBounds, Path, Ptr, PtrTy, Self, Ty}; +use self::ty::{LifetimeBounds, Path, Ptr, PtrTy, Self_, Ty}; pub mod ty; @@ -261,7 +261,7 @@ pub struct Substructure<'a> { pub type_ident: Ident, /// ident of the method pub method_ident: Ident, - /// dereferenced access to any `Self` or `Ptr(Self, _)` arguments + /// dereferenced access to any `Self_` or `Ptr(Self_, _)` arguments pub self_args: &'a [P<Expr>], /// verbatim access to any other arguments pub nonself_args: &'a [P<Expr>], @@ -679,10 +679,10 @@ impl<'a> MethodDef<'a> { match *ty { // for static methods, just treat any Self // arguments as a normal arg - Self if nonstatic => { + Self_ if nonstatic => { self_args.push(arg_expr); } - Ptr(box Self, _) if nonstatic => { + Ptr(box Self_, _) if nonstatic => { self_args.push(cx.expr_deref(trait_.span, arg_expr)) } _ => { diff --git a/src/libsyntax/ext/deriving/generic/ty.rs b/src/libsyntax/ext/deriving/generic/ty.rs index bbca5c599b1..ec13b86a8ae 100644 --- a/src/libsyntax/ext/deriving/generic/ty.rs +++ b/src/libsyntax/ext/deriving/generic/ty.rs @@ -87,7 +87,7 @@ impl<'a> Path<'a> { /// A type. Supports pointers, Self, and literals #[derive(Clone)] pub enum Ty<'a> { - Self, + Self_, /// &/Box/ Ty Ptr(Box<Ty<'a>>, PtrTy<'a>), /// mod::mod::Type<[lifetime], [Params...]>, including a plain type @@ -109,7 +109,7 @@ pub fn borrowed_explicit_self<'r>() -> Option<Option<PtrTy<'r>>> { } pub fn borrowed_self<'r>() -> Ty<'r> { - borrowed(box Self) + borrowed(box Self_) } pub fn nil_ty<'r>() -> Ty<'r> { @@ -149,7 +149,7 @@ impl<'a> Ty<'a> { } } Literal(ref p) => { p.to_ty(cx, span, self_ty, self_generics) } - Self => { + Self_ => { cx.ty_path(self.to_path(cx, span, self_ty, self_generics)) } Tuple(ref fields) => { @@ -168,7 +168,7 @@ impl<'a> Ty<'a> { self_generics: &Generics) -> ast::Path { match *self { - Self => { + Self_ => { let self_params = self_generics.ty_params.map(|ty_param| { cx.ty_ident(span, ty_param.ident) }); diff --git a/src/libsyntax/ext/deriving/primitive.rs b/src/libsyntax/ext/deriving/primitive.rs index bf742263c6d..22c87d978c9 100644 --- a/src/libsyntax/ext/deriving/primitive.rs +++ b/src/libsyntax/ext/deriving/primitive.rs @@ -41,7 +41,7 @@ pub fn expand_deriving_from_primitive<F>(cx: &mut ExtCtxt, args: vec!(Literal(path!(i64))), ret_ty: Literal(Path::new_(pathvec_std!(cx, core::option::Option), None, - vec!(box Self), + vec!(box Self_), true)), // #[inline] liable to cause code-bloat attributes: attrs.clone(), @@ -56,7 +56,7 @@ pub fn expand_deriving_from_primitive<F>(cx: &mut ExtCtxt, args: vec!(Literal(path!(u64))), ret_ty: Literal(Path::new_(pathvec_std!(cx, core::option::Option), None, - vec!(box Self), + vec!(box Self_), true)), // #[inline] liable to cause code-bloat attributes: attrs, diff --git a/src/libsyntax/ext/deriving/rand.rs b/src/libsyntax/ext/deriving/rand.rs index 4c3678d9572..029b6535108 100644 --- a/src/libsyntax/ext/deriving/rand.rs +++ b/src/libsyntax/ext/deriving/rand.rs @@ -53,7 +53,7 @@ pub fn expand_deriving_rand<F>(cx: &mut ExtCtxt, Ptr(box Literal(Path::new_local("R")), Borrowed(None, ast::MutMutable)) ), - ret_ty: Self, + ret_ty: Self_, attributes: Vec::new(), combine_substructure: combine_substructure(box |a, b, c| { rand_substructure(a, b, c) |
