Skip to content

Commit a376f46

Browse files
committed
librustc: Stop parsing [T * N].
1 parent 142dbd6 commit a376f46

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/librustc/middle/lang_items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub enum LangItem {
7878
}
7979

8080
pub struct LanguageItems {
81-
items: [ Option<def_id> * 35 ]
81+
items: [Option<def_id>, ..35]
8282
}
8383

8484
pub impl LanguageItems {

src/libsyntax/parse/obsolete.rs

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ pub enum ObsoleteSyntax {
6161
ObsoletePurity,
6262
ObsoleteStaticMethod,
6363
ObsoleteConstItem,
64+
ObsoleteFixedLengthVectorType,
6465
}
6566

6667
impl to_bytes::IterBytes for ObsoleteSyntax {
@@ -209,6 +210,10 @@ pub impl Parser {
209210
"`const` items are now `static` items; replace `const` with \
210211
`static`"
211212
),
213+
ObsoleteFixedLengthVectorType => (
214+
"fixed-length vector notation",
215+
"instead of `[T * N]`, write `[T, ..N]`"
216+
),
212217
};
213218

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

src/libsyntax/parse/parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ use parse::obsolete::{ObsoleteBareFnType, ObsoleteNewtypeEnum};
8181
use parse::obsolete::{ObsoleteMode, ObsoleteImplicitSelf};
8282
use parse::obsolete::{ObsoleteLifetimeNotation, ObsoleteConstManagedPointer};
8383
use parse::obsolete::{ObsoletePurity, ObsoleteStaticMethod};
84-
use parse::obsolete::{ObsoleteConstItem};
84+
use parse::obsolete::{ObsoleteConstItem, ObsoleteFixedLengthVectorType};
8585
use parse::prec::{as_prec, token_to_binop};
8686
use parse::token::{can_begin_expr, is_ident, is_ident_or_path};
8787
use parse::token::{is_plain_ident, INTERPOLATED, special_idents};
@@ -825,7 +825,7 @@ pub impl Parser {
825825

826826
fn maybe_parse_fixed_vstore(&self) -> Option<@ast::expr> {
827827
if self.eat(&token::BINOP(token::STAR)) {
828-
// XXX: Obsolete; remove after snapshot.
828+
self.obsolete(*self.last_span, ObsoleteFixedLengthVectorType);
829829
Some(self.parse_expr())
830830
} else if *self.token == token::COMMA &&
831831
self.look_ahead(1) == token::DOTDOT {

0 commit comments

Comments
 (0)