-
Notifications
You must be signed in to change notification settings - Fork 666
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
allow importing macros without helpers in the 2018 edition #1041
Conversation
Nix has traditionally been pretty conservative about raising the minimum compiler version, and this is a big bump. It could make Nix unusable by some distros' Rust packages. Worse, it might break platforms not supported by rustup that don't yet have compiler 1.30.0. Do you have any data about how widespread this compiler is? Also, how did you tell github that this PR is a draft? I haven't seen that feature before. |
I don't have any data for the usage of 1.30.0, unfortunately. If we're not comfortable bumping to 1.30.0, I can see how feasible using When you create a PR, you can click a dropdown next to the PR submission button to mark a PR as "Draft" :) |
Actually, here is some data on 1.30.0 usage: https://repology.org/project/rust/versions |
@asomers I'm now using |
Thanks for making that change. And thanks for the Rust versions link; I didn't know about that. But this needs a CHANGELOG entry. Can you please add one and describe how the visibility of macros has changed? |
This will allow users of the 2018 edition to import the macros without needing to also import their helpers.
Added an entry to the changelog. |
If the helper macros are no longer importable, then they should be mentioned in the "Removed" section of the changelog. |
They're still importable, it's just that you don't need to explicitly import them to use macros that use them internally anymore. |
Friendly ping @asomers |
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.
Ok, I get it. It's too bad we didn't notice local_inner_macros
before; it could've been useful!
bors r+
1041: allow importing macros without helpers in the 2018 edition r=asomers a=euclio ~This PR adds the `$crate::` prefix to all uses of helper macros, which will allow users of the 2018 edition to import the macros without needing to also import their helpers.~ See https://doc.rust-lang.org/edition-guide/rust-2018/macros/macro-changes.html#macros-with-crate-prefix for more info. ~While this is a cleaner solution than using `#[macro_export(local_inner_macros)]`, it also requires bumping the minimum supported compiler version to 1.30. If this is acceptable, I'll add a commit to update the Travis configuration and docs.~ This PR now uses `local_inner_macros` to preserve compatibility with the current minimum Rust version. Co-authored-by: Andy Russell <arussell123@gmail.com>
Build succeeded
|
This PR adds the$crate::
prefix to all uses of helper macros, which will allow users of the 2018 edition to import the macros without needing to also import their helpers.See https://doc.rust-lang.org/edition-guide/rust-2018/macros/macro-changes.html#macros-with-crate-prefix for more info.
While this is a cleaner solution than using#[macro_export(local_inner_macros)]
, it also requires bumping the minimum supported compiler version to 1.30. If this is acceptable, I'll add a commit to update the Travis configuration and docs.This PR now uses
local_inner_macros
to preserve compatibility with the current minimum Rust version.