Skip to content

pub with macro 2.0 breaks docs #45266

Closed
Closed
@valff

Description

@valff

Using pub qualifier with declarative macros 2.0 breaks the missing_docs lint for private items, as well as exposes them with rustdoc.

The following code shouldn't produce warnings (playground):

//! ...
#![feature(decl_macro)]
#![warn(missing_docs)]

/// ...
pub mod foo {
  // Try to comment out the macro, and warnings will be disappeared.
  pub macro bar() { println!("bar"); }
  
  #[allow(dead_code)]
  fn baz() {}
}

fn main() {}

rustc --version --verbose:

rustc 1.22.0-nightly (dcbbfb6e8 2017-10-12)
binary: rustc
commit-hash: dcbbfb6e807fdff9c9ba80073bb755f9d9d95e31
commit-date: 2017-10-12
host: x86_64-unknown-linux-gnu
release: 1.22.0-nightly
LLVM version: 4.0

Metadata

Metadata

Assignees

Labels

A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions