Add --cfg docsrs to all rustdoc invocations#2390
Merged
syphar merged 3 commits intorust-lang:masterfrom Feb 1, 2024
Merged
Conversation
Nemo157
reviewed
Jan 23, 2024
Nemo157
reviewed
Jan 23, 2024
syphar
approved these changes
Jan 31, 2024
Member
syphar
left a comment
There was a problem hiding this comment.
I agree, from what I see this has become the de-facto standard, so setting it by default is a good idea.
You could see this as a breaking change, but only if
- someone used the feature name
docsrsfor something else, or - the feature exists for future usage, but shouldn't be used yet.
Also having @epage on this topic makes me lean towards seeing these as edge-cases, and merging & deploying this.
|
Good thinking through those cases and I agree that those are edge enough cases that for a service like docs.rs it seems fine for moving forward. |
bors
added a commit
to rust-lang/cargo
that referenced
this pull request
Feb 1, 2024
Add `docsrs` cfg as a well known `--check-cfg` Now that rust-lang/docs.rs#2390 has been merged we can add the `docsrs` cfg in Cargo well known --check-cfg "list". The `docsrs` cfg used by at least [3k project on GitHub](https://github.com/search?q=lang%3Atoml+%2Frustdoc-args+%3D+%5C%5B%22--cfg%22%2C+%22docsrs%22%5C%5D%2F+NOT+is%3Afork&type=code&repo=&langOverride=&start_value=1) alone; including the cfg will help reduce the impact of enabling by default this feature. > We include it here (in Cargo) instead of rustc, since there is a much closer relationship between Cargo and docs.rs than rustc and docs.rs. In particular, all users of docs.rs use Cargo, but not all users of rustc (like Rust-for-Linux) use docs.rs. This is part of the last remaining bits of the `--check-cfg` feature. r? `@epage`
jplatte
added a commit
to ruma/ruma
that referenced
this pull request
May 29, 2024
- Don't instruct docs.rs to set it, it does so by default now: rust-lang/docs.rs#2390 - Because of that, check-cfg also recognizes it and does not need extra configuration either.
jplatte
added a commit
to ruma/ruma
that referenced
this pull request
May 30, 2024
- Don't instruct docs.rs to set it, it does so by default now: rust-lang/docs.rs#2390 - Because of that, check-cfg also recognizes it and does not need extra configuration either.
zydou
pushed a commit
to zydou/arti
that referenced
this pull request
Aug 7, 2024
Don't need to tell docs.rs to enable `docsrs` cfg. It does it automatically as of rust-lang/docs.rs#2390 (comment) While this change isn't in our MSRV yet, we were only using this when building for docs.rs, where we use the latest anyway. See merge request tpo/core/arti!2308
newpavlov
added a commit
to rust-random/getrandom
that referenced
this pull request
Dec 17, 2024
The flag is passed automatically for all docs.rs builds. See: rust-lang/docs.rs#2390
zecakeh
pushed a commit
to ruma/ruma-client
that referenced
this pull request
Mar 4, 2025
- Don't instruct docs.rs to set it, it does so by default now: rust-lang/docs.rs#2390 - Because of that, check-cfg also recognizes it and does not need extra configuration either.
axelkar
added a commit
to axelkar/abootimg-oxide
that referenced
this pull request
Jan 26, 2026
See rust-lang/docs.rs#2390 (note that the PR title is misleading; `--cfg docsrs` is only added for the "terminal crate")
takumi-earth
pushed a commit
to earthlings-dev/getrandom
that referenced
this pull request
Jan 27, 2026
…-random#565) The flag is passed automatically for all docs.rs builds. See: rust-lang/docs.rs#2390
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2389