-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Tracking issue for proc_macro::is_available() #71436
Comments
Is anything blocking stabilization of this feature? It seems pretty uncontroversial - if the |
One non-uncontroversial part is how to react if proc_macro might not be all-or-nothing in the future. For example if the whole token API is made to work outside a proc macro, but the diagnostics API via Span (warn, error, note, etc) would not be available. |
If the token api is made to work outside a proc macro, but the diagnostics api is not, I think users of proc_macro can just access the token api without checking |
I would really like for this feature to be stabilized. proc_macro2 is currently unusable with cg_clif outside of proc macros, as it checks if a proc macro function panics when being called. cg_clif doesn't yet support unwinding on panics. Also if the function proc_macro2 checks becomes available outside of a proc macro, that will break proc_macro2 usage outside of proc macros, so the sooner it migrates to |
Does the workaround described here not work for you? I'm running into a similar use-case, but the |
That doesn't help when you don't control the source. proc-macro2 is used by a dependency of the user's project most of the time. And even if it isn't, I can't except users of cg_clif to always add |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@rfcbot merge |
Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
I still share the concern that some APIs (but not all) may, in the future, be permitted to be used in any context, not just proc macros. Wouldn't |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
…lable, r=petrochenkov Stabilize proc_macro::is_available Tracking issue: rust-lang#71436 The FCP for the stabilization of `proc_macro::is_available` has completed.
2915: Update rust-toolchain to 2021-12-04 r=ppannuto a=lschuermann ### Pull Request Overview This pull request updates the Rust toolchain to version `1.59.0-nightly (efec54529 2021-12-04)`. The motivation for this change is that the `litex-sim-ci` breaks when compiling `elf2tab` on the previous toolchain version: ``` error[E0658]: use of unstable library feature 'proc_macro_is_available' --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.33/src/detection.rs:28:21 | 28 | let available = proc_macro::is_available(); | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #71436 <rust-lang/rust#71436> for more information = help: add `#![feature(proc_macro_is_available)]` to the crate attributes to enable For more information about this error, try `rustc --explain E0658`. error: could not compile `proc-macro2` due to previous error warning: build failed, waiting for other jobs to finish... error: failed to compile `elf2tab v0.8.0`, intermediate artifacts can be found at `/tmp/cargo-installl05bA0` ``` Now, I'm not entirely sure as to why this happens. We haven't upgraded either of the Rust toolchain or `elf2tab`, and -- as far as I understand -- `cargo install elf2tab` should use the `Cargo.lock` file, so dependencies shouldn't change. In any case, this update seems to fix it. Besides the failing `litex-sim-ci` workflow, it seems like a good idea to pin a `rustc` version on which vital tools such as `elf2tab` properly compile. I can also reproduce the `elf2tab` build failure locally while the `rust-toolchain` of the Tock repository is used. ### Testing Strategy This pull request was tested by CI. ### TODO or Help Wanted N/A ### Documentation Updated - [x] ~Updated the relevant files in `/docs`,~ or no updates are required. ### Formatting - [x] Ran `make prepush`. Co-authored-by: Leon Schuermann <leon@is.currently.online>
Fixes the following error: error[E0658]: use of unstable library feature 'proc_macro_is_available' --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.33/src/detection.rs:28:21 | 28 | let available = proc_macro::is_available(); | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #71436 <rust-lang/rust#71436> for more information = help: add `#![feature(proc_macro_is_available)]` to the crate attributes to enable For more information about this error, try `rustc --explain E0658`. error: could not compile `proc-macro2` due to previous error
Fixes the following error: error[E0658]: use of unstable library feature 'proc_macro_is_available' --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.33/src/detection.rs:28:21 | 28 | let available = proc_macro::is_available(); | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #71436 <rust-lang/rust#71436> for more information = help: add `#![feature(proc_macro_is_available)]` to the crate attributes to enable For more information about this error, try `rustc --explain E0658`. error: could not compile `proc-macro2` due to previous error
Fixes the following error: error[E0658]: use of unstable library feature 'proc_macro_is_available' --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.33/src/detection.rs:28:21 | 28 | let available = proc_macro::is_available(); | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #71436 <rust-lang/rust#71436> for more information = help: add `#![feature(proc_macro_is_available)]` to the crate attributes to enable For more information about this error, try `rustc --explain E0658`. error: could not compile `proc-macro2` due to previous error
You should update proc-macro2 (if you depend on it) and update to the latest rustc version. |
This is a tracking issue for
proc_macro::is_available()
.The feature gate for the issue is
#![feature(proc_macro_is_available)]
.About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also uses as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
Unresolved Questions
none yet
Implementation history
The text was updated successfully, but these errors were encountered: