-
-
Notifications
You must be signed in to change notification settings - Fork 15k
rustdoc: correctly propagate cfgs for glob reexports #157039
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| //@ compile-flags: --cfg feature="foo" --cfg feature="bar" --cfg feature="baz" | ||
|
|
||
| #![crate_name = "foo"] | ||
| #![feature(doc_cfg)] | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please also add the check for the |
||
| //================================================================================================== | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove that comment.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright, the idea was just to more easily separate the test cases visually. |
||
| //@ has 'foo/struct.A.html' | ||
| //@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ | ||
| // 'Available on crate features foo and bar only.' | ||
|
|
||
| mod a { | ||
| mod inner { | ||
| pub struct A {} | ||
| } | ||
| #[cfg(feature = "bar")] | ||
| pub use self::inner::A; | ||
| } | ||
| #[cfg(feature = "foo")] | ||
| pub use a::*; | ||
|
|
||
| //================================================================================================== | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same for this comment. |
||
| //@ has 'foo/struct.B.html' | ||
| //@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ | ||
| // 'Available on crate features foo and bar and baz only.' | ||
|
|
||
| mod b { | ||
| mod inner { | ||
| mod innermost { | ||
| pub struct B {} | ||
| } | ||
| #[cfg(feature = "baz")] | ||
| pub use self::innermost::B; | ||
| } | ||
| #[cfg(feature = "bar")] | ||
| pub use self::inner::*; | ||
| } | ||
| #[cfg(feature = "foo")] | ||
| pub use b::*; | ||
|
|
||
| //================================================================================================== | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| //@ has 'foo/struct.C.html' | ||
| //@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ | ||
| // 'Available on crate features foo and bar and baz only.' | ||
|
|
||
| mod c { | ||
| mod inner { | ||
| mod innermost { | ||
| #[cfg(feature = "baz")] | ||
| pub struct C {} | ||
| } | ||
| pub use self::innermost::*; | ||
| } | ||
| #[cfg(feature = "bar")] | ||
| pub use self::inner::*; | ||
| } | ||
| #[cfg(feature = "foo")] | ||
| pub use c::*; | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little tip: to avoid using
compile-flags, it's better to wrap thecfgattributes insidenot().View changes since the review