-
Notifications
You must be signed in to change notification settings - Fork 13k
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
move get_ident
and get_name
free function onto the Ident
and Name
types
#27234
move get_ident
and get_name
free function onto the Ident
and Name
types
#27234
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @huonw (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Do we need |
@@ -313,10 +313,10 @@ mod svh_visitor { | |||
// Ad-hoc overloading between Ident and Name to their intern table lookups. | |||
trait InternKey { fn get_content(self) -> token::InternedString; } |
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.
@eddyb: I could implement something like this... maybe From<Ident/Name> for InternedString
?
cc @rust-lang/compiler |
looks nice to me. |
410abfa
to
cc476e9
Compare
☔ The latest upstream changes (presumably #27283) made this pull request unmergeable. Please resolve the merge conflicts. |
d6d1e51
to
2f6d5dd
Compare
rebased and applied @eddyb's suggestion to make caused additional fallout obviously. |
@@ -166,12 +159,15 @@ pub const ILLEGAL_CTXT : SyntaxContext = 1; | |||
RustcEncodable, RustcDecodable, Clone, Copy)] | |||
pub struct Name(pub u32); | |||
|
|||
impl<T: AsRef<str>> PartialEq<T> for Name { |
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.
I figured this would make life a lot easier. sadly I cannot implement the commutative version of this.
The alternative was often &*ident.name.as_str() == "text"
when it's now ident.name == "text"
@oli-obk Apart from the |
r? @eddyb (seems to have it under control) |
cfd225b
to
abc3317
Compare
removed into-impl, replaced all calls by |
@bors r+ |
📌 Commit abc3317 has been approved by |
⌛ Testing commit abc3317 with merge 1232a4d... |
💔 Test failed - auto-mac-64-nopt-t |
abc3317
to
00a5e66
Compare
sorry about that. I had sporadic failures in now "make check" passed without a single complaint. |
@bors r+ |
📌 Commit 00a5e66 has been approved by |
this has quite some fallout. but also made lots of stuff more readable imo [breaking-change] for plugin authors
this has quite some fallout. but also made lots of stuff more readable imo
[breaking-change] for plugin authors