Skip to content

Commit eda85fe

Browse files
committed
Auto merge of #28348 - petrochenkov:novirt, r=alexcrichton
Noticed these yesterday while reading libsyntax
2 parents fbeef72 + 9f1f4c1 commit eda85fe

File tree

4 files changed

+8
-22
lines changed

4 files changed

+8
-22
lines changed

src/doc/reference.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2367,9 +2367,6 @@ The currently implemented features of the reference compiler are:
23672367
into a Rust program. This capability, especially the signature for the
23682368
annotated function, is subject to change.
23692369

2370-
* `struct_inherit` - Allows using struct inheritance, which is barely
2371-
implemented and will probably be removed. Don't use this.
2372-
23732370
* `struct_variant` - Structural enum variants (those with named fields). It is
23742371
currently unknown whether this style of enum variant is as
23752372
fully supported as the tuple-forms, and it's not certain

src/libsyntax/parse/parser.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4692,11 +4692,6 @@ impl<'a> Parser<'a> {
46924692
let class_name = try!(self.parse_ident());
46934693
let mut generics = try!(self.parse_generics());
46944694

4695-
if try!(self.eat(&token::Colon) ){
4696-
let ty = try!(self.parse_ty_sum());
4697-
self.span_err(ty.span, "`virtual` structs have been removed from the language");
4698-
}
4699-
47004695
// There is a special case worth noting here, as reported in issue #17904.
47014696
// If we are parsing a tuple struct it is the case that the where clause
47024697
// should follow the field list. Like so:
@@ -5383,11 +5378,6 @@ impl<'a> Parser<'a> {
53835378
try!(self.expect_one_of(&[], &[]));
53845379
}
53855380

5386-
if try!(self.eat_keyword_noexpect(keywords::Virtual) ){
5387-
let span = self.span;
5388-
self.span_err(span, "`virtual` structs have been removed from the language");
5389-
}
5390-
53915381
if try!(self.eat_keyword(keywords::Static) ){
53925382
// STATIC ITEM
53935383
let m = if try!(self.eat_keyword(keywords::Mut)) {MutMutable} else {MutImmutable};

src/libsyntax/parse/token.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -575,13 +575,13 @@ declare_special_idents_and_keywords! {
575575
(36, Type, "type");
576576
(37, Unsafe, "unsafe");
577577
(38, Use, "use");
578-
(39, Virtual, "virtual");
579-
(40, While, "while");
580-
(41, Continue, "continue");
581-
(42, Box, "box");
582-
(43, Const, "const");
583-
(44, Where, "where");
578+
(39, While, "while");
579+
(40, Continue, "continue");
580+
(41, Box, "box");
581+
(42, Const, "const");
582+
(43, Where, "where");
584583
'reserved:
584+
(44, Virtual, "virtual");
585585
(45, Proc, "proc");
586586
(46, Alignof, "alignof");
587587
(47, Become, "become");

src/test/parse-fail/virtual-structs.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
// compile-flags: -Z parse-only
1212

1313
// Test diagnostics for the removed struct inheritance feature.
14-
#![feature(struct_inherit)]
1514

16-
virtual struct SuperStruct { //~ ERROR `virtual` structs have been removed from the language
15+
virtual struct SuperStruct { //~ ERROR expected item, found `virtual`
1716
f1: isize,
1817
}
1918

20-
struct Struct : SuperStruct; //~ ERROR `virtual` structs have been removed from the language
19+
struct Struct : SuperStruct;
2120

2221
pub fn main() {}

0 commit comments

Comments
 (0)