Skip to content

Conversation

@jonas-schievink
Copy link
Contributor

fixes #8680

bors r+

bors bot added a commit that referenced this pull request May 7, 2021
8748: fix: use raw idents in `make::{name, name_ref}` when used with a keyword r=jonas-schievink a=jonas-schievink

fixes #8680

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
@bors
Copy link
Contributor

bors bot commented May 7, 2021

Build failed:

@jonas-schievink
Copy link
Contributor Author

jonas-schievink commented May 7, 2021

oh, this is going to be more complicated

@jonas-schievink
Copy link
Contributor Author

bors r+


fn raw_ident_esc(ident: &str) -> &'static str {
let is_keyword = parser::SyntaxKind::from_keyword(ident).is_some();
if is_keyword && !matches!(ident, "self" | "crate" | "super" | "Self") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that Self is an odd one out here? (or from_keyword is really weird?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, Self is a keyword, TIL!

@bors
Copy link
Contributor

bors bot commented May 7, 2021

@bors bors bot merged commit 0bc85ac into rust-lang:master May 7, 2021
@jonas-schievink jonas-schievink deleted the make-name-from-keyword branch May 7, 2021 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic when computing missing fields diagnostic with raw ident fields

2 participants