Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

rustdoc ignores deprecation markers on constants #57917

Closed
Mark-Simulacrum opened this issue Jan 26, 2019 · 3 comments
Closed

rustdoc ignores deprecation markers on constants #57917

Mark-Simulacrum opened this issue Jan 26, 2019 · 3 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Mark-Simulacrum
Copy link
Member

Compare https://github.com/rust-lang/rust/blob/master/src/libcore/sync/atomic.rs#L293 to https://doc.rust-lang.org/nightly/std/sync/atomic/constant.ATOMIC_BOOL_INIT.html; I would expect the constant to be marked as deprecated. Interestingly, the source code also lacks the deprecation marker: https://doc.rust-lang.org/nightly/src/core/sync/atomic.rs.html#255.

I've not attempted to verify this locally, but it seems good to investigate this.

@Mark-Simulacrum Mark-Simulacrum added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jan 26, 2019
@euclio
Copy link
Contributor

euclio commented Jan 26, 2019

A simple local test case works for me:

#![feature(staged_api)]

#![unstable(feature = "rustc-deprecated-test", reason = "reason", issue = "1")]

// @has rustc_deprecated/constant.FOO.html '//*[@class="stab deprecated"]' \
//      'Deprecated since 1.2.3: because I said so'
#[rustc_deprecated(since = "1.2.3", reason = "because I said so")]
#[stable(feature = "rust1", since = "1.0.0")]
pub const FOO: usize = 1;

// @has rustc_deprecated/static.BAR.html '//*[@class="stab deprecated"]' \
//      'Deprecating in 2.0.0: no reason'
#[rustc_deprecated(since = "2.0.0", reason = "no reason")]
#[stable(feature = "rust1", since = "1.0.0")]
pub static BAR: usize = 1;

Needs some more investigation.

@ollie27
Copy link
Member

ollie27 commented Jan 27, 2019

#57425 was only merged about 4 hours before this issue was opened so presumably the nightly docs hadn't been updated yet. The docs are now updated and show the depreciation warning as expected:
image

@Mark-Simulacrum
Copy link
Member Author

Yep, I thought we has stabilized these a while back but must be misremembering.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants