-
Notifications
You must be signed in to change notification settings - Fork 136
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
Modernize the codebase #204
Conversation
Mercurial uses |
Pinging @gracinet in case you have anything to add. |
I thought that might be the case. I can drop the |
This will allow us to use edition 2018.
Since we are targetting 1.32, and std::mem::MaybeUninit wasn't stabilized until 1.36, suppress the deprecation warning.
Use the `paste` crate to generate the module init symbol names (`initfoo` and `PyInit_foo`), rather than requiring the user to pass them in. This makes creating modules less error-prone.
@markbt You could play with config attributes to silence warnings depending on the version? |
Using I'll wait to see what @gracinet says, but hopefully this PR is now suitable for merging. |
@markbt yes we'll want to be able to build Mercurial Rust extensions on Debian buster, hence 1.34 and maybe even submit that for buster-backports, who knows? I'll take a closer look this evening if I can or maybe tomorrow. |
I've switched to 1.32 now (which is the minimum version for edition 2018 and a couple of the associated syntax improvements). That should mean it works on stock Debian buster, although please do check. I've suppressed the deprecation warnings for now. There's no real rush to replace |
I've tested successfully with the Rust toolchain of Debian 10:
and unsurprisingly have also been able to build Mercurial's |
Thanks for this, @markbt, switching to the 2018 edition will be a boon. And this unlocks the procedural macros |
I've read the whole diff quickly.
|
I think there's at least one fix in |
@markbt no, I can't publish directly on crates.io. Did all the other preparations, including the tag |
Putting this up as an RFC.
This updates to more modern code, including edition 2018. It now requires rustc 1.36 so that we can use things like
AssumeUninit
(without this, all thestd::mem::uninitialized()
calls show up as warnings).Rust 1.36 was released over 6 months ago. However, it looks like Debian stable is pinned at 1.34, so if we want to keep targetting that as a minumum, we won't be able to take all of this. In practice I would expect users of Rust that are keeping their dependent crates up-to-date would also be using rustup to keep the compiler up-to-date, too.
Any comments?