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

Update all the crates to the 2021 edition #3568

Merged
merged 1 commit into from
Mar 26, 2023

Conversation

weiznich
Copy link
Member

This is mostly just running cargo fix --edition and cargo fix --edition-idioms

@weiznich weiznich requested a review from a team March 25, 2023 17:37
# hack to get a `diesel` item inside of diesel
# as well as for using diesel-derives in external crates
edition = "2015"
edition = "2021"
Copy link
Member

Choose a reason for hiding this comment

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

We need this 2015, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

We needed it before #3564
I tried that migration already yesterday and noticed that dependencies. I did not think much about that and went on trying to minimize one of the rust-analyzer type issues with diesel, so that the rust-analyzer team had at least a minimal example without depending on diesel. While doing that someone from that team said that they cannot explain how name resolution even worked for code generated by diesel proc-macro. Because I hit that by accident a bit earlier I was able to explain that and they suggested the extern crate self as diesel; fix. That in turn remove the need to use the 2015 edition there, so after all that's all somehow related.

Copy link
Member

Choose a reason for hiding this comment

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

Weird, I remember trying this exact trick when I was refactoring the derives. But, it didn't work back then, so I thought maybe the issue was something else and ended up keeping the old hack.

#[cfg(feature = "sqlite")]
extern crate diesel_migrations;
extern crate dotenvy;
extern crate quickcheck;
Copy link
Member

Choose a reason for hiding this comment

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

Mistake?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's fine. extern crate … statements are not required anymore, so we can remove them (even those with a #[cfg] on.)

This is mostly just running `cargo fix --edition` and `cargo fix --edition-idioms`
@weiznich weiznich force-pushed the update/edition_to_2021 branch from 17bee10 to aa28629 Compare March 25, 2023 18:25
@weiznich weiznich added this pull request to the merge queue Mar 26, 2023
Merged via the queue into diesel-rs:master with commit 4644782 Mar 26, 2023
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.

2 participants