Skip to content
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 #983

Merged
merged 2 commits into from May 18, 2022
Merged

Edition 2018 #983

merged 2 commits into from May 18, 2022

Conversation

tcharding
Copy link
Member

@tcharding tcharding commented May 2, 2022

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 :)

@tcharding tcharding mentioned this pull request May 2, 2022
@tcharding tcharding force-pushed the edition-2018 branch 7 times, most recently from 715f510 to 85afd86 Compare May 3, 2022 00:26
dunxen
dunxen previously approved these changes May 3, 2022
Copy link
Contributor

@dunxen dunxen left a comment

Choose a reason for hiding this comment

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

cr-ACK 85afd86

Verified 060fb32 by running cargo fix --edition on bcc923c and committing to yield local commit de5b6d3. git diff de5b6d3 060fb32 returns no changes.
Reviewed 85afd86 changes manually.

LGTM

apoelstra
apoelstra previously approved these changes May 4, 2022
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 85afd86

This all looks good to me.

Use cargo to upgrade from edition 2015 to edition 2018.

 cargo fix --edition

No manual changes made. The result of the command above is just to fix
all the use statements (add `crate::`) and fix the fully qualified path
formats i.e., `::Foo` -> `crate::Foo`.
Add 'edition = "2018"' to the manifest and do a bunch of manual path
fixups (use statements and fully qualified paths).
@tcharding
Copy link
Member Author

Rebased

Copy link
Contributor

@dunxen dunxen left a comment

Choose a reason for hiding this comment

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

re-ACK 9f0c687

@tcharding
Copy link
Member Author

tcharding commented May 11, 2022

Thanks for the reviews @dunxen!

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

re-ACK 9f0c687

@tcharding
Copy link
Member Author

Not much interest in this one, I'm surprised. I'm personally pretty excited to get edition 2018 into the rust-bitcoin stack and the improvements that can be done on top of it. Can we get this one in crew?

Copy link
Collaborator

@RCasatta RCasatta left a comment

Choose a reason for hiding this comment

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

ACK 9f0c687,

my cargo fix --edition didn't produce exactly dca0d67, but differences are minimal

--- a/src/blockdata/witness.rs
+++ b/src/blockdata/witness.rs
@@ -302,12 +302,12 @@ impl<'de> serde::Deserialize<'de> for Witness {
 
 #[cfg(test)]
 mod test {
-    use crate::blockdata::transaction::EcdsaSighashType;
-    use crate::blockdata::witness::Witness;
+    use super::*;
+
     use crate::consensus::{deserialize, serialize};
     use crate::hashes::hex::{FromHex, ToHex};
     use crate::Transaction;
-    use secp256k1::ecdsa;
+    use crate::secp256k1::ecdsa;

@tcharding
Copy link
Member Author

Thanks @RCasatta!

@apoelstra
Copy link
Member

Nice, let's do it!

@apoelstra apoelstra merged commit 50d9394 into rust-bitcoin:master May 18, 2022
@apoelstra
Copy link
Member

Likely to cause rebase issues but very simple ones. (And actually maybe not, since it mostly only touches import statements..)

@tcharding
Copy link
Member Author

BOOM!

@tcharding tcharding deleted the edition-2018 branch May 19, 2022 01:26
ChallengeDev210 pushed a commit to ChallengeDev210/rust-bitcoin that referenced this pull request Aug 1, 2022
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
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.

None yet

4 participants