Remove the proc keyword again

This commit is contained in:
Vadim Petrochenkov
2018-05-13 16:35:52 +03:00
parent c4352ff198
commit dae5f05f43
25 changed files with 31 additions and 451 deletions
+7 -13
View File
@@ -386,25 +386,20 @@ pub fn fresh() -> Self {
// Edition-specific keywords reserved for future use.
(55, Async, "async") // >= 2018 Edition Only
(56, Proc, "proc") // <= 2015 Edition Only
// Special lifetime names
(57, UnderscoreLifetime, "'_")
(58, StaticLifetime, "'static")
(56, UnderscoreLifetime, "'_")
(57, StaticLifetime, "'static")
// Weak keywords, have special meaning only in specific contexts.
(59, Auto, "auto")
(60, Catch, "catch")
(61, Default, "default")
(62, Dyn, "dyn")
(63, Union, "union")
(58, Auto, "auto")
(59, Catch, "catch")
(60, Default, "default")
(61, Dyn, "dyn")
(62, Union, "union")
}
impl Symbol {
fn is_unused_keyword_2015(self) -> bool {
self == keywords::Proc.name()
}
fn is_unused_keyword_2018(self) -> bool {
self == keywords::Async.name()
}
@@ -426,7 +421,6 @@ pub fn is_used_keyword(self) -> bool {
pub fn is_unused_keyword(self) -> bool {
// Note: `span.edition()` is relatively expensive, don't call it unless necessary.
self.name >= keywords::Abstract.name() && self.name <= keywords::Yield.name() ||
self.name.is_unused_keyword_2015() && self.span.edition() == Edition::Edition2015 ||
self.name.is_unused_keyword_2018() && self.span.edition() == Edition::Edition2018
}