Open zvolin opened 6 months ago
potentially affected crates can be searched with https://github.com/search?q=%2Frustdoc-args.*--cfg.*docs_rs%2F&type=code
but that only includes the crates using the docs_rs
attribute, github doesn't support look around regexes so I didn't find a way to search for ones which have 'not docsrs'
Indeed, after switching to
docsrs
everything is fine. I found that it's explicitely included here because that's what docs.rs uses internally, however I couldn't find it in any documentation, nor in the "well-known" names.
This is documented in https://docs.rs/about/builds#detecting-docsrs.
And yeah agree this is a bit hard to discover. The Cargo team has talked about documenting the interaction of --check-cfg
between rustc, cargo and other systems. Currently we don't have a simple answer for that.
Problem
Recently standardized
--check-cfg
started triggering in my project. There is some common pattern in crates that want to use another nightly feature,doc_cfg
, to do stuff like:The cfg attribute was used just to conditionally include the
doc_cfg
feature so that it is only present in docs.rs builds and not require nightly on a daily basis. When adding this I found no mention or whatever about any requirements for the name of the additional cfg flag used for this guard. It looked likedocsrs
is most widely used (eg. by tokio), however I opted in fordocs_rs
as I found it easier to read.After standardizing of
--check-cfg
it turned out it's failing with the given message:Indeed, after switching to
docsrs
everything is fine. I found that it's explicitely included here because that's what docs.rs uses internally, however I couldn't find it in any documentation, nor in the "well-known" names.Steps
No response
Possible Solution(s)
No response
Notes
No response
Version