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

Clarify rustc-args vs rustdoc-args in cross-compiling section #2284

Closed
Nemo157 opened this issue Oct 20, 2023 · 2 comments
Closed

Clarify rustc-args vs rustdoc-args in cross-compiling section #2284

Nemo157 opened this issue Oct 20, 2023 · 2 comments

Comments

@Nemo157
Copy link
Member

Nemo157 commented Oct 20, 2023

You can configure how your crate is built by adding package metadata to your Cargo.toml, e.g.:

[package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]

https://docs.rs/about/builds#cross-compiling

This may be a little confusing compared to the standard practice of rustdoc-args = ["--cfg", "docsrs"], this section should clarify that this cfg is used for things like the build.rs or dependencies but not for the docs themselves.

@ChrisDenton
Copy link
Member

ChrisDenton commented Oct 20, 2023

I think the sentence after that also makes it sound more generally applicable then it is:

Here, the compiler arguments are set so that #[cfg(docsrs)] (not to be confused with #[cfg(doc)]) can be used for conditional compilation.

Which I think may have confused me (though I don't quite remember). EDIT: In any case it would be good to have the standard practice documented somewhere on that page.

@syphar
Copy link
Member

syphar commented Feb 14, 2024

I assume after #2390 this should be clear enough?

Closing this issue, feel free to reopen when not.

@syphar syphar closed this as completed Feb 14, 2024
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

No branches or pull requests

3 participants