about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-03-27 13:27:58 -0700
committerbors <bors@rust-lang.org>2013-03-27 13:27:58 -0700
commit995425badba216e38c8eb1e4c6dd6989c50660b3 (patch)
tree8a9b88670b9775c34eaae843aeb6701019071392 /src/libsyntax
parent2a74fda316f5c4b31d3582fd1cf7b6c04c178557 (diff)
parent069529bc5cc14f63035609cdfae5b21ca7999d4b (diff)
downloadrust-995425badba216e38c8eb1e4c6dd6989c50660b3.tar.gz
rust-995425badba216e38c8eb1e4c6dd6989c50660b3.zip
auto merge of #5558 : nikomatsakis/rust/issue-4920-autoref-index-operator, r=nikomatsakis
Per discussion on IRC.

r? @pcwalton
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs1
-rw-r--r--src/libsyntax/ext/deriving/clone.rs2
-rw-r--r--src/libsyntax/ext/deriving/eq.rs2
-rw-r--r--src/libsyntax/ext/deriving/iter_bytes.rs2
-rw-r--r--src/libsyntax/ext/deriving/mod.rs2
-rw-r--r--src/libsyntax/parse/parser.rs27
-rw-r--r--src/libsyntax/print/pprust.rs5
7 files changed, 11 insertions, 30 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 9112e92df7e..12d4e9d5e24 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -1004,7 +1004,6 @@ impl to_bytes::IterBytes for ret_style {
 #[deriving(Eq)]
 pub enum self_ty_ {
     sty_static,                                // no self
-    sty_by_ref,                                // ``
     sty_value,                                 // `self`
     sty_region(Option<@Lifetime>, mutability), // `&'lt self`
     sty_box(mutability),                       // `@self`
diff --git a/src/libsyntax/ext/deriving/clone.rs b/src/libsyntax/ext/deriving/clone.rs
index 68458bd516e..df4dd2735fc 100644
--- a/src/libsyntax/ext/deriving/clone.rs
+++ b/src/libsyntax/ext/deriving/clone.rs
@@ -17,7 +17,7 @@ use ast::{item_enum, item_impl, item_struct, Generics};
 use ast::{m_imm, meta_item, method};
 use ast::{named_field, or, pat, pat_ident, pat_wild, public, pure_fn};
 use ast::{stmt, struct_def, struct_variant_kind};
-use ast::{sty_by_ref, sty_region, tuple_variant_kind, ty_nil, TyParam};
+use ast::{sty_region, tuple_variant_kind, ty_nil, TyParam};
 use ast::{TyParamBound, ty_path, ty_rptr, unnamed_field, variant};
 use ext::base::ext_ctxt;
 use ext::build;
diff --git a/src/libsyntax/ext/deriving/eq.rs b/src/libsyntax/ext/deriving/eq.rs
index 8cee6bd7290..531390035db 100644
--- a/src/libsyntax/ext/deriving/eq.rs
+++ b/src/libsyntax/ext/deriving/eq.rs
@@ -17,7 +17,7 @@ use ast::{item_enum, item_impl, item_struct, Generics};
 use ast::{m_imm, meta_item, method};
 use ast::{named_field, or, pat, pat_ident, pat_wild, public, pure_fn};
 use ast::{stmt, struct_def, struct_variant_kind};
-use ast::{sty_by_ref, sty_region, tuple_variant_kind, ty_nil, TyParam};
+use ast::{sty_region, tuple_variant_kind, ty_nil, TyParam};
 use ast::{TyParamBound, ty_path, ty_rptr, unnamed_field, variant};
 use ext::base::ext_ctxt;
 use ext::build;
diff --git a/src/libsyntax/ext/deriving/iter_bytes.rs b/src/libsyntax/ext/deriving/iter_bytes.rs
index 3c1ee7e0296..528db0d1072 100644
--- a/src/libsyntax/ext/deriving/iter_bytes.rs
+++ b/src/libsyntax/ext/deriving/iter_bytes.rs
@@ -17,7 +17,7 @@ use ast::{item_enum, item_impl, item_struct, Generics};
 use ast::{m_imm, meta_item, method};
 use ast::{named_field, or, pat, pat_ident, pat_wild, public, pure_fn};
 use ast::{stmt, struct_def, struct_variant_kind};
-use ast::{sty_by_ref, sty_region, tuple_variant_kind, ty_nil, TyParam};
+use ast::{sty_region, tuple_variant_kind, ty_nil, TyParam};
 use ast::{TyParamBound, ty_path, ty_rptr, unnamed_field, variant};
 use ext::base::ext_ctxt;
 use ext::build;
diff --git a/src/libsyntax/ext/deriving/mod.rs b/src/libsyntax/ext/deriving/mod.rs
index e879bcdc476..21477d6e067 100644
--- a/src/libsyntax/ext/deriving/mod.rs
+++ b/src/libsyntax/ext/deriving/mod.rs
@@ -20,7 +20,7 @@ use ast::{item_enum, item_impl, item_struct, Generics};
 use ast::{m_imm, meta_item, method};
 use ast::{named_field, or, pat, pat_ident, pat_wild, public, pure_fn};
 use ast::{stmt, struct_def, struct_variant_kind};
-use ast::{sty_by_ref, sty_region, tuple_variant_kind, ty_nil, TyParam};
+use ast::{sty_region, tuple_variant_kind, ty_nil, TyParam};
 use ast::{TyParamBound, ty_path, ty_rptr, unnamed_field, variant};
 use ext::base::ext_ctxt;
 use ext::build;
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index c82151bb4a9..c2e7ecacd20 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -46,7 +46,7 @@ use ast::{rem, required};
 use ast::{ret_style, return_val, self_ty, shl, shr, stmt, stmt_decl};
 use ast::{stmt_expr, stmt_semi, stmt_mac, struct_def, struct_field};
 use ast::{struct_immutable, struct_mutable, struct_variant_kind, subtract};
-use ast::{sty_box, sty_by_ref, sty_region, sty_static, sty_uniq, sty_value};
+use ast::{sty_box, sty_region, sty_static, sty_uniq, sty_value};
 use ast::{token_tree, trait_method, trait_ref, tt_delim, tt_seq, tt_tok};
 use ast::{tt_nonterminal, tuple_variant_kind, Ty, ty_, ty_bot, ty_box};
 use ast::{ty_field, ty_fixed_length_vec, ty_closure, ty_bare_fn};
@@ -472,8 +472,6 @@ pub impl Parser {
         ) |p| {
             let attrs = p.parse_outer_attributes();
             let lo = p.span.lo;
-            let is_static = p.parse_staticness();
-            let static_sty = spanned(lo, p.span.hi, sty_static);
 
             let vis = p.parse_visibility();
             let pur = p.parse_fn_purity();
@@ -488,12 +486,6 @@ pub impl Parser {
                 // names to be left off if there is a definition...
                 either::Left(p.parse_arg_general(false))
             };
-            // XXX: Wrong. Shouldn't allow both static and self_ty
-            let self_ty = if is_static || self_ty.node == sty_by_ref {
-                static_sty
-            } else {
-                self_ty
-            };
 
             let hi = p.last_span.hi;
             debug!("parse_trait_methods(): trait method signature ends in \
@@ -2878,7 +2870,7 @@ pub impl Parser {
                 p.expect_self_ident();
                 cnstr(mutability)
             } else {
-                sty_by_ref
+                sty_static
             }
         }
 
@@ -2927,7 +2919,7 @@ pub impl Parser {
                 self.expect_self_ident();
                 sty_region(Some(lifetime), mutability)
             } else {
-                sty_by_ref
+                sty_static
             }
         }
 
@@ -2951,13 +2943,13 @@ pub impl Parser {
             sty_value
           }
           _ => {
-            sty_by_ref
+            sty_static
           }
         };
 
         // If we parsed a self type, expect a comma before the argument list.
         let args_or_capture_items;
-        if self_ty != sty_by_ref {
+        if self_ty != sty_static {
             match *self.token {
                 token::COMMA => {
                     self.bump();
@@ -3059,9 +3051,6 @@ pub impl Parser {
         let attrs = self.parse_outer_attributes();
         let lo = self.span.lo;
 
-        let is_static = self.parse_staticness();
-        let static_sty = spanned(lo, self.span.hi, sty_static);
-
         let visa = self.parse_visibility();
         let pur = self.parse_fn_purity();
         let ident = self.parse_ident();
@@ -3069,12 +3058,6 @@ pub impl Parser {
         let (self_ty, decl) = do self.parse_fn_decl_with_self() |p| {
             p.parse_arg()
         };
-        // XXX: interaction between staticness, self_ty is broken now
-        let self_ty = if is_static || self_ty.node == sty_by_ref {
-            static_sty
-        } else {
-            self_ty
-        };
 
         let (inner_attrs, body) = self.parse_inner_attrs_and_block(true);
         let hi = body.span.hi;
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index a6064b467b1..9fffed7074b 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -1648,7 +1648,7 @@ pub fn print_pat(s: @ps, &&pat: @ast::pat, refutable: bool) {
 // Returns whether it printed anything
 pub fn print_self_ty(s: @ps, self_ty: ast::self_ty_) -> bool {
     match self_ty {
-        ast::sty_static | ast::sty_by_ref => { return false; }
+        ast::sty_static => { return false; }
         ast::sty_value => { word(s.s, ~"self"); }
         ast::sty_region(lt, m) => {
             word(s.s, ~"&");
@@ -1674,7 +1674,7 @@ pub fn print_fn(s: @ps,
                 opt_self_ty: Option<ast::self_ty_>,
                 vis: ast::visibility) {
     head(s, ~"");
-    print_fn_header_info(s, opt_self_ty, purity, ast::Many, None, vis);
+    print_fn_header_info(s, purity, ast::Many, None, vis);
     nbsp(s);
     print_ident(s, name);
     print_generics(s, generics);
@@ -2181,7 +2181,6 @@ pub fn print_opt_sigil(s: @ps, opt_sigil: Option<ast::Sigil>) {
 }
 
 pub fn print_fn_header_info(s: @ps,
-                            opt_sty: Option<ast::self_ty_>,
                             purity: ast::purity,
                             onceness: ast::Onceness,
                             opt_sigil: Option<ast::Sigil>,