Skip to content

Commit 39189de

Browse files
committed
---
yaml --- r: 49826 b: refs/heads/auto c: a34749c h: refs/heads/master v: v3
1 parent ddf3a8c commit 39189de

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 1fcb0443cf2a5575691b70e7ef80e9720bc4bc07
17+
refs/heads/auto: a34749c28908997f8c58a646c9238c3dd8ea1103
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ pub enum ObsoleteSyntax {
5454
ObsoleteAssertion,
5555
ObsoletePostFnTySigil,
5656
ObsoleteBareFnType,
57+
ObsoleteNewtypeEnum,
5758
}
5859

5960
impl to_bytes::IterBytes for ObsoleteSyntax {
@@ -171,6 +172,10 @@ pub impl Parser {
171172
"bare function type",
172173
"use `&fn` or `extern fn` instead"
173174
),
175+
ObsoleteNewtypeEnum => (
176+
"newtype enum",
177+
"instead of `enum Foo = int`, write `struct Foo(int)`"
178+
),
174179
};
175180

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

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,8 @@ use parse::obsolete::{ObsoleteUnsafeBlock, ObsoleteImplSyntax};
7676
use parse::obsolete::{ObsoleteTraitBoundSeparator, ObsoleteMutOwnedPointer};
7777
use parse::obsolete::{ObsoleteMutVector, ObsoleteTraitImplVisibility};
7878
use parse::obsolete::{ObsoleteRecordType, ObsoleteRecordPattern};
79-
<<<<<<< HEAD
8079
use parse::obsolete::{ObsoleteAssertion, ObsoletePostFnTySigil};
81-
=======
82-
use parse::obsolete::{ObsoleteAssertion, ObsoleteBareFnType};
83-
>>>>>>> libsyntax: Stop parsing bare functions in preparation for switching them over
80+
use parse::obsolete::{ObsoleteBareFnType, ObsoleteNewtypeEnum};
8481
use parse::prec::{as_prec, token_to_binop};
8582
use parse::token::{can_begin_expr, is_ident, is_ident_or_path};
8683
use parse::token::{is_plain_ident, INTERPOLATED, special_idents};
@@ -651,14 +648,9 @@ pub impl Parser {
651648
} else if self.eat_keyword(&~"extern") {
652649
self.parse_ty_bare_fn()
653650
} else if self.token_is_closure_keyword(&copy *self.token) {
654-
<<<<<<< HEAD
655-
// self.warn(fmt!("Old-school closure keyword"));
656-
self.parse_ty_closure(ast::BorrowedSigil, None)
657-
=======
658-
let result = self.parse_ty_closure(None, None);
651+
let result = self.parse_ty_closure(ast::BorrowedSigil, None);
659652
self.obsolete(*self.last_span, ObsoleteBareFnType);
660653
result
661-
>>>>>>> libsyntax: Stop parsing bare functions in preparation for switching them over
662654
} else if *self.token == token::MOD_SEP
663655
|| is_ident_or_path(&*self.token) {
664656
let path = self.parse_path_with_tps(colons_before_params);
@@ -3798,6 +3790,8 @@ pub impl Parser {
37983790
vis: public,
37993791
});
38003792

3793+
self.obsolete(*self.last_span, ObsoleteNewtypeEnum);
3794+
38013795
return (
38023796
id,
38033797
item_enum(

0 commit comments

Comments
 (0)