Skip to content

Commit 4bad515

Browse files
committed
rm ancient error for lowercase kinds
3 of these kinds no longer even exist in the CamelCase form
1 parent e07e49e commit 4bad515

File tree

3 files changed

+3
-44
lines changed

3 files changed

+3
-44
lines changed

src/libsyntax/parse/obsolete.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use std::to_bytes;
3030
/// The specific types of unsupported syntax
3131
#[deriving(Eq)]
3232
pub enum ObsoleteSyntax {
33-
ObsoleteLowerCaseKindBounds,
3433
ObsoleteLet,
3534
ObsoleteFieldTerminator,
3635
ObsoleteStructCtor,
@@ -96,12 +95,6 @@ impl ParserObsoleteMethods for Parser {
9695
/// Reports an obsolete syntax non-fatal error.
9796
pub fn obsolete(&self, sp: span, kind: ObsoleteSyntax) {
9897
let (kind_str, desc) = match kind {
99-
ObsoleteLowerCaseKindBounds => (
100-
"lower-case kind bounds",
101-
"the `send`, `copy`, `const`, and `owned` \
102-
kinds are represented as traits now, and \
103-
should be camel cased"
104-
),
10598
ObsoleteLet => (
10699
"`let` in field declaration",
107100
"declare fields as `field: Type`"

src/libsyntax/parse/parser.rs

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ use parse::lexer::TokenAndSpan;
7171
use parse::obsolete::{ObsoleteClassTraits};
7272
use parse::obsolete::{ObsoleteLet, ObsoleteFieldTerminator};
7373
use parse::obsolete::{ObsoleteMoveInit, ObsoleteBinaryMove, ObsoleteSwap};
74-
use parse::obsolete::{ObsoleteSyntax, ObsoleteLowerCaseKindBounds};
74+
use parse::obsolete::ObsoleteSyntax;
7575
use parse::obsolete::{ObsoleteUnsafeBlock, ObsoleteImplSyntax};
7676
use parse::obsolete::{ObsoleteMutOwnedPointer};
7777
use parse::obsolete::{ObsoleteMutVector, ObsoleteImplVisibility};
@@ -3309,30 +3309,8 @@ impl Parser {
33093309
self.bump();
33103310
}
33113311
token::MOD_SEP | token::IDENT(*) => {
3312-
let obsolete_bound = match *self.token {
3313-
token::MOD_SEP => false,
3314-
token::IDENT(sid, _) => {
3315-
match self.id_to_str(sid).as_slice() {
3316-
"send" |
3317-
"copy" |
3318-
"const" |
3319-
"owned" => {
3320-
self.obsolete(
3321-
*self.span,
3322-
ObsoleteLowerCaseKindBounds);
3323-
self.bump();
3324-
true
3325-
}
3326-
_ => false
3327-
}
3328-
}
3329-
_ => fail!()
3330-
};
3331-
3332-
if !obsolete_bound {
3333-
let tref = self.parse_trait_ref();
3334-
result.push(TraitTyParamBound(tref));
3335-
}
3312+
let tref = self.parse_trait_ref();
3313+
result.push(TraitTyParamBound(tref));
33363314
}
33373315
_ => break,
33383316
}

src/test/compile-fail/obsolete-syntax.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
fn f1<T:copy>() -> T { }
12-
//~^ ERROR obsolete syntax: lower-case kind bounds
13-
14-
fn f1<T:send>() -> T { }
15-
//~^ ERROR obsolete syntax: lower-case kind bounds
16-
17-
fn f1<T:const>() -> T { }
18-
//~^ ERROR obsolete syntax: lower-case kind bounds
19-
20-
fn f1<T:owned>() -> T { }
21-
//~^ ERROR obsolete syntax: lower-case kind bounds
22-
2311
struct s {
2412
let foo: (),
2513
//~^ ERROR obsolete syntax: `let` in field declaration

0 commit comments

Comments
 (0)