Skip to content

Commit

Permalink
rm ancient error for lowercase kinds
Browse files Browse the repository at this point in the history
3 of these kinds no longer even exist in the CamelCase form
  • Loading branch information
thestinger committed Aug 1, 2013
1 parent e07e49e commit 4bad515
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 44 deletions.
7 changes: 0 additions & 7 deletions src/libsyntax/parse/obsolete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use std::to_bytes;
/// The specific types of unsupported syntax
#[deriving(Eq)]
pub enum ObsoleteSyntax {
ObsoleteLowerCaseKindBounds,
ObsoleteLet,
ObsoleteFieldTerminator,
ObsoleteStructCtor,
Expand Down Expand Up @@ -96,12 +95,6 @@ impl ParserObsoleteMethods for Parser {
/// Reports an obsolete syntax non-fatal error.
pub fn obsolete(&self, sp: span, kind: ObsoleteSyntax) {
let (kind_str, desc) = match kind {
ObsoleteLowerCaseKindBounds => (
"lower-case kind bounds",
"the `send`, `copy`, `const`, and `owned` \
kinds are represented as traits now, and \
should be camel cased"
),
ObsoleteLet => (
"`let` in field declaration",
"declare fields as `field: Type`"
Expand Down
28 changes: 3 additions & 25 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ use parse::lexer::TokenAndSpan;
use parse::obsolete::{ObsoleteClassTraits};
use parse::obsolete::{ObsoleteLet, ObsoleteFieldTerminator};
use parse::obsolete::{ObsoleteMoveInit, ObsoleteBinaryMove, ObsoleteSwap};
use parse::obsolete::{ObsoleteSyntax, ObsoleteLowerCaseKindBounds};
use parse::obsolete::ObsoleteSyntax;
use parse::obsolete::{ObsoleteUnsafeBlock, ObsoleteImplSyntax};
use parse::obsolete::{ObsoleteMutOwnedPointer};
use parse::obsolete::{ObsoleteMutVector, ObsoleteImplVisibility};
Expand Down Expand Up @@ -3309,30 +3309,8 @@ impl Parser {
self.bump();
}
token::MOD_SEP | token::IDENT(*) => {
let obsolete_bound = match *self.token {
token::MOD_SEP => false,
token::IDENT(sid, _) => {
match self.id_to_str(sid).as_slice() {
"send" |
"copy" |
"const" |
"owned" => {
self.obsolete(
*self.span,
ObsoleteLowerCaseKindBounds);
self.bump();
true
}
_ => false
}
}
_ => fail!()
};

if !obsolete_bound {
let tref = self.parse_trait_ref();
result.push(TraitTyParamBound(tref));
}
let tref = self.parse_trait_ref();
result.push(TraitTyParamBound(tref));
}
_ => break,
}
Expand Down
12 changes: 0 additions & 12 deletions src/test/compile-fail/obsolete-syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn f1<T:copy>() -> T { }
//~^ ERROR obsolete syntax: lower-case kind bounds

fn f1<T:send>() -> T { }
//~^ ERROR obsolete syntax: lower-case kind bounds

fn f1<T:const>() -> T { }
//~^ ERROR obsolete syntax: lower-case kind bounds

fn f1<T:owned>() -> T { }
//~^ ERROR obsolete syntax: lower-case kind bounds

struct s {
let foo: (),
//~^ ERROR obsolete syntax: `let` in field declaration
Expand Down

0 comments on commit 4bad515

Please sign in to comment.