about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-03-12 22:36:46 -0700
committerPatrick Walton <pcwalton@mimiga.net>2013-03-13 20:07:11 -0700
commit2ccc6e0a57660aaf84c70208bb98c5eb4285de3a (patch)
tree077344341afcae1dca54bccf9e8bd87914fa9f9f /src/libsyntax/parse/parser.rs
parentac60d53c65fe499660ea6b508200283bb3cdb19d (diff)
downloadrust-2ccc6e0a57660aaf84c70208bb98c5eb4285de3a.tar.gz
rust-2ccc6e0a57660aaf84c70208bb98c5eb4285de3a.zip
librustc: Don't require the "static" keyword to define a static method
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 815a8bfab5d..a30b910b347 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -469,11 +469,11 @@ pub impl Parser {
                 either::Left(p.parse_arg_general(false))
             };
             // XXX: Wrong. Shouldn't allow both static and self_ty
-            let self_ty = if is_static { static_sty } else { self_ty };
-
-            if self_ty.node == sty_by_ref {
-                self.obsolete(self_ty.span, ObsoleteImplicitSelf);
-            }
+            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 \
@@ -2983,11 +2983,11 @@ pub impl Parser {
             p.parse_arg()
         };
         // XXX: interaction between staticness, self_ty is broken now
-        let self_ty = if is_static { static_sty} else { self_ty };
-
-        if self_ty.node == sty_by_ref {
-            self.obsolete(self_ty.span, ObsoleteImplicitSelf);
-        }
+        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;