-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libsyntax: Do not derive Hash for Ident #28823
Conversation
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
r? @nrc |
@@ -35,7 +35,7 @@ use std::collections::HashMap; | |||
pub struct SCTable { | |||
table: RefCell<Vec<SyntaxContext_>>, | |||
mark_memo: RefCell<HashMap<(SyntaxContext,Mrk),SyntaxContext>>, | |||
rename_memo: RefCell<HashMap<(SyntaxContext,Name,SyntaxContext,Name),SyntaxContext>>, | |||
rename_memo: RefCell<HashMap<(SyntaxContext,(Name,SyntaxContext),Name),SyntaxContext>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why make this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for clarity. It's actually an Ident
(and it was literally Ident
before #28642), but it should be hashed and compared as pair and not as an Ident.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment explaining this please?
This seems like a good change, but I wonder if we should be hashing idents at all - do we need the hash implementation? |
All larger structures in AST/HIR need it to derive their |
I assume you want to do this as a follow-up, not here? |
r+ with the comment |
I wasn't sure if it was needed to be done, maybe third party plugins or tools hash parts of AST or who knows, but if removing these hashes is ok, then yes, I'd prefer to do it later. |
@bors: r+ |
📌 Commit b82d76c has been approved by |
Closes #28658