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
Fix token_to_integer to not require Copyable #670
base: master
Are you sure you want to change the base?
Conversation
We can simply use a reference
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.
This seems fine, but I'm curious why the call to sort
was removed?
@@ -176,7 +176,7 @@ impl<'s> LowerState<'s> { | |||
|
|||
read_algorithm(&grammar.annotations, &mut algorithm); | |||
|
|||
let mut all_terminals: Vec<_> = self | |||
let all_terminals: Vec<_> = self |
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 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.
mut was not necessary
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.
@Destroyerrrocket As I understand, he is asking about the removed sort below.
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.
Yep, that sort caused problems while trying to match str&. Tbf, it's been a while and I don't remember all the details, but it gave me problems...
@@ -19,7 +19,7 @@ macro_rules! return_err { | |||
return Err(NormError { | |||
message: format!($($args),+), | |||
span: $span | |||
}); | |||
}) |
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.
Isn't there a compatibility warning about this?
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.
The original code makes warning. The changed one is fine.
This way the order of the match arms is preserved, otherwise some arms that are more general would be moved over more specific ones. |
In this issue I explained in detail what that sort does: |
Hmmm, could we split off the Copy restriction from the sorting to unblock bf55006? That seems like something easy to merge on its own. |
We can simply use a reference