Skip to content

#[deny(missing_docs)] ignores exported macro_rules! #56334

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

Closed
kaikalii opened this issue Nov 29, 2018 · 5 comments
Closed

#[deny(missing_docs)] ignores exported macro_rules! #56334

kaikalii opened this issue Nov 29, 2018 · 5 comments
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@kaikalii
Copy link

If my crate exports a macro_rules! macro, the deny(missing_docs) attribute has no effect even though it probably should.

The following code should, at the very least, provide a warning

#[deny(missing_docs)]
#[macro_export]
macro_rules! foo {
    () => {}
}

Preventing this code from compiling would likely break some backwards compatability, but I don't see why it shouldn't at least give a warning.

@Centril Centril added A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Nov 30, 2018
@Centril
Copy link
Contributor

Centril commented Nov 30, 2018

cc @petrochenkov @rust-lang/lang I cannot decide whether this is expected behavior or not, but it makes sense that missing_docs should fire on exported macros.

@cramertj
Copy link
Member

cramertj commented Dec 3, 2018

Preventing this code from compiling would likely break some backwards compatability

We don't guarantee backwards-compatibility for #![deny(warnings)], otherwise we would never be able to introduce a new warning. I agree that missing deny(missing_docs) should error on crate-exported macros with no documentation.

@scottmcm
Copy link
Member

Lang team discussion agreed with the two comments above; the lint should warn for this.

bors added a commit that referenced this issue Jan 8, 2019
… r=varkor

check missing docs for reexported macros as well

Fixes #56334.
@nnethercote
Copy link
Contributor

This broke compilation of existing code in the rustc-perf benchmark suite, see rust-lang/rustc-perf#325

I see the comment "We don't guarantee backwards-compatibility for #![deny(warnings)]" above, but I thought it might be useful to note some practical consequences.

@cramertj
Copy link
Member

@nnethercote Seems like that suite should set -cap-lints=allow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants