Skip to content
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

missing_docs not triggered when missing docs on trait alias #111025

Closed
zopsicle opened this issue Apr 30, 2023 · 5 comments
Closed

missing_docs not triggered when missing docs on trait alias #111025

zopsicle opened this issue Apr 30, 2023 · 5 comments
Assignees
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@zopsicle
Copy link
Contributor

zopsicle commented Apr 30, 2023

I tried this code:

//! example
#![feature(trait_alias)]
#![warn(missing_docs)]
pub trait T = Send;

I expected to see this happen: “missing documentation for a trait alias” diagnostic

Instead, this happened: no diagnostic

Meta

Using 1.71.0-nightly 2023-04-29 87b1f89.

@zopsicle zopsicle added the C-bug Category: This is a bug. label Apr 30, 2023
@mj10021
Copy link
Contributor

mj10021 commented Apr 30, 2023

@rustbot claim

@mj10021
Copy link
Contributor

mj10021 commented Apr 30, 2023

Running the following code on the nightly:

#![feature(trait_alias)]
#![warn(missing_docs)]

pub trait T = Send;

gives the following output:

   Compiling playground v0.0.1 (/playground)
warning: missing documentation for the crate
 --> src/lib.rs:1:1
  |
1 | / #![feature(trait_alias)]
2 | | #![warn(missing_docs)]
3 | |
4 | | pub trait T = Send;
  | |___________________^
  |
note: the lint level is defined here
 --> src/lib.rs:2:9
  |
2 | #![warn(missing_docs)]
  |         ^^^^^^^^^^^^

So I guess the difference is the //! example ?

@zopsicle
Copy link
Contributor Author

zopsicle commented May 1, 2023

That diagnostic warns about missing docs on the crate, but not on the trait alias.

@mj10021
Copy link
Contributor

mj10021 commented May 1, 2023

That diagnostic warns about missing docs on the crate, but not on the trait alias.

Ah yes, thanks

@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label May 1, 2023
@jyn514 jyn514 added the A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. label May 1, 2023
JohnTitor added a commit to JohnTitor/rust that referenced this issue May 7, 2023
…henkov

added TraitAlias to check_item() for missing_docs

As in issue rust-lang#111025 the `missing_docs` was not being triggered for trait aliases.  I added `TraitAlias` to the pattern match for check_item(), and the lint seems to be behaving appropriately
@zopsicle
Copy link
Contributor Author

zopsicle commented Aug 9, 2023

This is now fixed.

@zopsicle zopsicle closed this as completed Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. 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

4 participants