Skip to content

Commit 6499636

Browse files
committed
---
yaml --- r: 139215 b: refs/heads/try2 c: fa70709 h: refs/heads/master i: 139213: 6aa5c0d 139211: 803fe2d 139207: ff90d2e 139199: d669d06 v: v3
1 parent 02d4bc9 commit 6499636

File tree

6 files changed

+27
-9
lines changed

6 files changed

+27
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: d60a7259f9f7855aefac17596f66bc4c863dfe7a
8+
refs/heads/try2: fa70709e07983fb62d1fddadac0987c79e836d23
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/rt/sched.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl Task {
311311
};
312312
}
313313

314-
static priv fn build_start_wrapper(start: ~fn()) -> ~fn() {
314+
priv fn build_start_wrapper(start: ~fn()) -> ~fn() {
315315
// XXX: The old code didn't have this extra allocation
316316
let wrapper: ~fn() = || {
317317
start();

branches/try2/src/librustpkg/rustpkg.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct PackageScript {
5757
}
5858

5959
impl PackageScript {
60-
static fn parse(parent: &Path) -> Result<PackageScript, ~str> {
60+
fn parse(parent: &Path) -> Result<PackageScript, ~str> {
6161
let script = parent.push(~"pkg.rs");
6262

6363
if !os::path_exists(&script) {

branches/try2/src/libsyntax/parse/obsolete.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ pub enum ObsoleteSyntax {
5959
ObsoleteImplicitSelf,
6060
ObsoleteLifetimeNotation,
6161
ObsoleteConstManagedPointer,
62+
ObsoletePurity,
63+
ObsoleteStaticMethod,
6264
}
6365

6466
impl to_bytes::IterBytes for ObsoleteSyntax {
@@ -198,6 +200,14 @@ pub impl Parser {
198200
"const `@` pointer",
199201
"instead of `@const Foo`, write `@Foo`"
200202
),
203+
ObsoletePurity => (
204+
"pure function",
205+
"remove `pure`"
206+
),
207+
ObsoleteStaticMethod => (
208+
"`static` notation",
209+
"`static` is superfluous; remove it"
210+
),
201211
};
202212

203213
self.report(sp, kind, kind_str, desc);

branches/try2/src/libsyntax/parse/parser.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ use parse::obsolete::{ObsoleteAssertion, ObsoletePostFnTySigil};
8080
use parse::obsolete::{ObsoleteBareFnType, ObsoleteNewtypeEnum};
8181
use parse::obsolete::{ObsoleteMode, ObsoleteImplicitSelf};
8282
use parse::obsolete::{ObsoleteLifetimeNotation, ObsoleteConstManagedPointer};
83+
use parse::obsolete::{ObsoletePurity, ObsoleteStaticMethod};
8384
use parse::prec::{as_prec, token_to_binop};
8485
use parse::token::{can_begin_expr, is_ident, is_ident_or_path};
8586
use parse::token::{is_plain_ident, INTERPOLATED, special_idents};
@@ -413,7 +414,7 @@ pub impl Parser {
413414

414415
fn parse_purity(&self) -> purity {
415416
if self.eat_keyword(&~"pure") {
416-
// NB: We parse this as impure for bootstrapping purposes.
417+
self.obsolete(*self.last_span, ObsoletePurity);
417418
return impure_fn;
418419
} else if self.eat_keyword(&~"unsafe") {
419420
return unsafe_fn;
@@ -2684,7 +2685,7 @@ pub impl Parser {
26842685

26852686
fn parse_optional_purity(&self) -> ast::purity {
26862687
if self.eat_keyword(&~"pure") {
2687-
// NB: We parse this as impure for bootstrapping purposes.
2688+
self.obsolete(*self.last_span, ObsoletePurity);
26882689
ast::impure_fn
26892690
} else if self.eat_keyword(&~"unsafe") {
26902691
ast::unsafe_fn
@@ -3341,8 +3342,14 @@ pub impl Parser {
33413342
else if self.eat_keyword(&~"priv") { private }
33423343
else { inherited }
33433344
}
3345+
33443346
fn parse_staticness(&self) -> bool {
3345-
self.eat_keyword(&~"static")
3347+
if self.eat_keyword(&~"static") {
3348+
self.obsolete(*self.last_span, ObsoleteStaticMethod);
3349+
true
3350+
} else {
3351+
false
3352+
}
33463353
}
33473354

33483355
// given a termination token and a vector of already-parsed
@@ -3580,6 +3587,7 @@ pub impl Parser {
35803587
fn parse_fn_purity(&self) -> purity {
35813588
if self.eat_keyword(&~"fn") { impure_fn }
35823589
else if self.eat_keyword(&~"pure") {
3590+
self.obsolete(*self.last_span, ObsoletePurity);
35833591
self.expect_keyword(&~"fn");
35843592
// NB: We parse this as impure for bootstrapping purposes.
35853593
impure_fn
@@ -3979,7 +3987,7 @@ pub impl Parser {
39793987
}
39803988
if items_allowed && self.eat_keyword(&~"pure") {
39813989
// PURE FUNCTION ITEM
3982-
// NB: We parse this as impure for bootstrapping purposes.
3990+
self.obsolete(*self.last_span, ObsoletePurity);
39833991
self.expect_keyword(&~"fn");
39843992
let (ident, item_, extra_attrs) = self.parse_item_fn(impure_fn);
39853993
return iovi_item(self.mk_item(lo, self.last_span.hi, ident, item_,

branches/try2/src/test/auxiliary/static_fn_inline_xc_aux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
pub mod num {
1313
pub trait Num2 {
14-
static fn from_int2(n: int) -> Self;
14+
fn from_int2(n: int) -> Self;
1515
}
1616
}
1717

1818
pub mod float {
1919
impl ::num::Num2 for float {
2020
#[inline]
21-
static fn from_int2(n: int) -> float { return n as float; }
21+
fn from_int2(n: int) -> float { return n as float; }
2222
}
2323
}
2424

0 commit comments

Comments
 (0)