From 2ccc6e0a57660aaf84c70208bb98c5eb4285de3a Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 12 Mar 2013 22:36:46 -0700 Subject: [PATCH] librustc: Don't require the "static" keyword to define a static method --- src/libsyntax/parse/parser.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 815a8bfab5df..a30b910b347e 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;