-
Notifications
You must be signed in to change notification settings - Fork 691
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
Edition 2018 #635
Edition 2018 #635
Conversation
This is the result of running: ``` cargo +1.36.0 fix --edition --all --broken-code --features="base64,rand,use-serde" ``` And manually fixing [cargo fix bug](rust-lang/rust#87578)
This changes edition to 2018 and manually fixes a few leftover paths.
All crates currently work with 1.36, so pinning is not needed.
Ran command: ``` cargo +1.36.0 fix --edition-idioms --all --broken-code --features="base64,rand,use-serde" ``` And manually fixed mistakes. Also looks like it didn't strip `::` from `::core`, so this was done "manually" (regex) too.
Was probably pasted accidentally.
These were added during conversion to edition 2018.
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.
Nice work, thanks for pushing this forward!
I think to merge, @apoelstra wants every commit to pass CI so we will need to squash almost all of this together into one.
It is a noisy diff but easy to to go through. Concept ACK from my side. As done here, only the minimally needed changes should be good to merge this. Refinements can be done in follow-ups!
I intend to squash it all into one commit as it'd be quite annoying to rewrite history. (I know how to do it and I did it several times but in this case I expect it to be too much work.) Does anyone wish to keep some steps? |
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.
utACK. The amount of painstaking work here is very impressive. I do confirm that these changes are nothing else than just
- Change of
::
prefixes tocrate::
- Removal of unnecessary
extern crate
imports - Addition of lifetime placeholders (
<'_>
) where they are required
I left few Nits and further optimization questions since this will require squash anyway.
All other improvements related to 2018 edition should be clearly done with a separate PRs in very small sets, otherwise it will take forever to review and merge.
@@ -10,15 +10,10 @@ fi | |||
|
|||
pin_common_verions() { |
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.
Nit: I think we can rename this into cleanup
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 was thinking of keeping it if some dependencies update their MSRV. But not really sure if it's better than renaming.
This removes needless `extern crate` and changes `pub use x` to `pub extern crate x` which is more clear in its intent.
7eb1f15
@dr-orlovsky resolved nits except the naming which I'm unsure about which semantics we want to keep. Thankfully it was not that painstaking - despite its flaws |
The `test` crate is provided by the compiler and seems to be exceptional in needing `extern crate test` declaration.
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.
utACK, will do a thorough tests later
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.
Few more comments after line-checking diff with the previous version
impl str::FromStr for SigHashType { | ||
impl core::str::FromStr for SigHashType { |
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.
How this was working with no_std before?
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.
No clue, I was surprised as well.
concept ACK. I'd like to first get a breaking version out that implements Taproot and nothing else, which could mean rebasing this several times, unfortunately. But the alternative is probably to rebase every single other PR, and we're running out of pre-Taproot time.. I'm willing to make an exception to the "every commit passes" rule for something like this. |
I'm fine with Taproot and nothing else approach. I didn't have much time for this lately anyway. |
|
@Kixunil Everything with the label has been resolved. We can now proceed with this PR. |
OK, I expect this week to be intense for me. If anyone has the time you can overtake. If not, I will try next week or even this one if I get lucky. |
Done, thanks for blessing me to do so. #983. I'm going to close this so as folk don't get confused. |
9f0c687 Enable edition 2018 (Tobin C. Harding) dca0d67 Fix in preparation for next edition (Tobin C. Harding) Pull request description: This PR supersedes #635 at the permission of @Kixunil in the thread of that PR. Do a minimal set of changes to enable edition 2018. Patch 1 is the biggest change set, it is done with `cargo`, no other manual changes are included in patch 1. It can verified by running `cargo fix --edition` on master and checking the diffs are the same. Patch 2 enables 2018 and includes all the manual changes required to get the code to build (with _all_ the feature combinations :) ACKs for top commit: dunxen: re-ACK 9f0c687 apoelstra: re-ACK 9f0c687 RCasatta: ACK 9f0c687, Tree-SHA512: 7c23554adb4c1dd932af1e80f04397bad0418b4fdae2d0fe243c3f19ba1169686a386bffd38a3c02871c7544b5a7bc8af525b50617a2695726408c091700f081
This changes edition to 2018 with a bunch of semi-automated fixes.
I suggest keeping #510 open because this doesn't implement all things mentioned there.
The diff is large but each change should be trivial/obvious.