Skip to content
Permalink
Browse files

review comments

  • Loading branch information
estebank committed Nov 24, 2019
1 parent 4f25c61 commit 180388670ee38f49578ef2b9eb878c95c4a31e41
Showing with 3 additions and 11 deletions.
  1. +1 −1 src/librustc_resolve/lib.rs
  2. +2 −10 src/libsyntax_pos/symbol.rs
@@ -2893,7 +2893,7 @@ fn names_to_string(names: &[Name]) -> String {
if i > 0 {
result.push_str("::");
}
if name.is_used_keyword() && name.can_be_raw() {
if Ident::with_dummy_span(*name).is_raw_guess() {
result.push_str("r#");
}
result.push_str(&name.as_str());
@@ -1013,15 +1013,7 @@ pub mod sym {
}

impl Symbol {
pub fn is_used_keyword(self) -> bool {
self.is_used_keyword_2015() || self.is_used_keyword_2018()
}

pub fn is_used_keyword_2015(self) -> bool {
self >= kw::As && self <= kw::While
}

pub fn is_used_keyword_2018(self) -> bool {
fn is_used_keyword_2018(self) -> bool {
self >= kw::Async && self <= kw::Dyn
}

@@ -1065,7 +1057,7 @@ impl Ident {
/// Returns `true` if the token is a keyword used in the language.
pub fn is_used_keyword(self) -> bool {
// Note: `span.edition()` is relatively expensive, don't call it unless necessary.
self.name.is_used_keyword_2015() ||
self.name >= kw::As && self.name <= kw::While ||
self.name.is_used_keyword_2018() && self.span.rust_2018()
}

0 comments on commit 1803886

Please sign in to comment.
You can’t perform that action at this time.