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

make is_{arch}_feature_detected! available for std #1081

Closed
wants to merge 1 commit into from

Conversation

the8472
Copy link
Member

@the8472 the8472 commented Mar 13, 2021

The feature detection macros currently can't be used in std itself due to these errors.

error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
   --> library/std/src/time.rs:30:5
    |
30  | use super::is_x86_feature_detected;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[deny(macro_expanded_macro_exports_accessed_by_absolute_paths)]` on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #52234 <https://github.com/rust-lang/rust/issues/52234>
note: the macro is defined here
   --> library/std/src/../../stdarch/crates/std_detect/src/detect/macros.rs:14:9

The workaround in this PR was suggested in this zulip discussion

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@Amanieu
Copy link
Member

Amanieu commented Mar 13, 2021

Note that with #1005, std_detect is a separate crate instead of a sub-module of std.

@the8472
Copy link
Member Author

the8472 commented Mar 13, 2021

Will std be updated to use it that way in the near future?

@Amanieu
Copy link
Member

Amanieu commented Mar 13, 2021

Yes, I plan on updating the stdarch submodule in std as soon as #1052 lands, which is blocked on rust-lang/rust#82838.

@Amanieu
Copy link
Member

Amanieu commented Mar 13, 2021

Actually there might be a libs team FCP on the merge due to the const generics changes, which may take a while to resolve.

@the8472
Copy link
Member Author

the8472 commented Mar 13, 2021

Well, this only for a small optimization. I'll just submit a rust PR and note that it's blocked.

@the8472 the8472 closed this Mar 13, 2021
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.

3 participants