Implement RFC 2421, 'Keyword unreservations (pure, sizeof, alignof, offsetof)'
This commit is contained in:
parent
61d88318aa
commit
ebc315bbbb
2 changed files with 18 additions and 35 deletions
|
@ -384,34 +384,30 @@ declare_keywords! {
|
||||||
|
|
||||||
// Keywords reserved for future use.
|
// Keywords reserved for future use.
|
||||||
(40, Abstract, "abstract")
|
(40, Abstract, "abstract")
|
||||||
(41, Alignof, "alignof")
|
(41, Become, "become")
|
||||||
(42, Become, "become")
|
(42, Do, "do")
|
||||||
(43, Do, "do")
|
(43, Final, "final")
|
||||||
(44, Final, "final")
|
(44, Macro, "macro")
|
||||||
(45, Macro, "macro")
|
(45, Override, "override")
|
||||||
(46, Offsetof, "offsetof")
|
(46, Priv, "priv")
|
||||||
(47, Override, "override")
|
(47, Typeof, "typeof")
|
||||||
(48, Priv, "priv")
|
(48, Unsized, "unsized")
|
||||||
(49, Pure, "pure")
|
(49, Virtual, "virtual")
|
||||||
(50, Sizeof, "sizeof")
|
(50, Yield, "yield")
|
||||||
(51, Typeof, "typeof")
|
|
||||||
(52, Unsized, "unsized")
|
|
||||||
(53, Virtual, "virtual")
|
|
||||||
(54, Yield, "yield")
|
|
||||||
|
|
||||||
// Edition-specific keywords reserved for future use.
|
// Edition-specific keywords reserved for future use.
|
||||||
(55, Async, "async") // >= 2018 Edition Only
|
(51, Async, "async") // >= 2018 Edition Only
|
||||||
|
|
||||||
// Special lifetime names
|
// Special lifetime names
|
||||||
(56, UnderscoreLifetime, "'_")
|
(52, UnderscoreLifetime, "'_")
|
||||||
(57, StaticLifetime, "'static")
|
(53, StaticLifetime, "'static")
|
||||||
|
|
||||||
// Weak keywords, have special meaning only in specific contexts.
|
// Weak keywords, have special meaning only in specific contexts.
|
||||||
(58, Auto, "auto")
|
(54, Auto, "auto")
|
||||||
(59, Catch, "catch")
|
(55, Catch, "catch")
|
||||||
(60, Default, "default")
|
(56, Default, "default")
|
||||||
(61, Dyn, "dyn")
|
(57, Dyn, "dyn")
|
||||||
(62, Union, "union")
|
(58, Union, "union")
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Symbol {
|
impl Symbol {
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
|
||||||
// file at the top-level directory of this distribution and at
|
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
||||||
// option. This file may not be copied, modified, or distributed
|
|
||||||
// except according to those terms.
|
|
||||||
|
|
||||||
// compile-flags: -Z parse-only
|
|
||||||
|
|
||||||
pure fn f() {} //~ ERROR expected item, found `pure`
|
|
Loading…
Reference in a new issue