-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Note warning of default features on libc #34132
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
Conversation
The default features of libc include libstd. This should be noted on this page.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (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. |
Thanks! Agree 100%. It might be nice to show how not to do this as well? |
I'm not sure I understand what you mean by how not to do this? I had considered adding an example of how to do this with cargo but excluded those in the PR. I'm happy to change it however you see fit. We could make this a slightly larger section with an example of the libc dependency in cargo.toml? |
Including a sample Cargo.toml seems like a good idea. Also why are there so many hidden lines in the example? Is what rustdoc ends up showing really correct? |
The reason they're hidden is that they use the internal |
@AtheMathmo just a typo. I meant how to do it, sorry :( Yeah, a slightly larger section showing a |
Before I jump in - should I stick with a quoted note or make a new section? i.e.
OR Warning: Default features in libcThe default features for libc include the standard library that we are trying to exclude. You must explicitly disable these. You can exclude the default features by modifying your
|
I'd make it a new section. We sorta assume you know how to include an external crate in the current version of the text, but it might be worth using this to explain that; just saying that we need libc, here's how you include it, and make sure you turn off default features. Also, using |
Have included an example of a Cargo.toml file containing the libc dependency. The file has been reformatted to use sections. The note on the default features warning is part of the _Using libc_ section but is in bold.
Thanks for the feedback! Have added a new section with more details on including libc. Let me know if you want anything added/removed/reformatted. |
@bors: r+ rollup Thanks again! |
📌 Commit 8844fd4 has been approved by |
Note warning of default features on libc The default features of libc include libstd. This should be noted on this page.
The default features of libc include libstd. This should be noted on this page.