Skip to content

Support cfg_attr #5548

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

Closed
mehmooda opened this issue Jul 27, 2020 · 4 comments
Closed

Support cfg_attr #5548

mehmooda opened this issue Jul 27, 2020 · 4 comments
Labels
S-actionable Someone could pick this issue up and work on it right now

Comments

@mehmooda
Copy link

It seems the following is currently not supported:

#[cfg_attr(target_os = "windows", path = "os_windows.rs)]
mod os;

I've had to do the following:

#[cfg(target_os = "windows")]
mod os_windows;
#[cfg(target_os = "windows")]
use os_windows as os;
@crumblingstatue
Copy link

The following is not highlighted as code in the doc string

    #[cfg_attr(feature = "ci-headless", doc = "```no_run")]
    #[cfg_attr(not(feature = "ci-headless"), doc = "```")]
    /// Code goes here...
    /// ```

Not sure if only because of the missing cfg_attr support, or if there are other factors too.

bors bot added a commit that referenced this issue Dec 18, 2020
6934: Implement `cfg_attr` handling r=jonas-schievink a=jonas-schievink

Part of #5548

Co-authored-by: Jonas Schievink <[email protected]>
@jonas-schievink
Copy link
Contributor

I've now added cfg_attr support. The code in the original report should now work fine, but there are still some parts of r-a that use syntactical attributes, so they don't handle cfg_attr.

@c410-f3r
Copy link
Contributor

cc #5016

@flodiebold flodiebold added the S-actionable Someone could pick this issue up and work on it right now label Dec 21, 2020
@jonas-schievink
Copy link
Contributor

Doc comments don't work with #[doc] attributes at all, so this isn't due to cfg_attr (though this is fixed by #8059).

Closing this issue. For any other cfg_attr related problems, new issues should be filed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

5 participants