rust-lang / rust-lang/rust-clippy

False negative of `empty_docs` when processing proc-macros

Open
#16,382 1 comment 0 reactions 1 assignee View on GitHub

@andogq is already working on this.

Since Sep 3, 2026.

C-bug I-false-negative
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

Summary

False negative of empty_docs when processing proc-macros.

This issue should be handled with #16317 together.

Lint Name

empty_docs

Reproducer

I tried this code:

// src/lib.rs:
#![warn(clippy::empty_docs)]

#[cxx::bridge]
pub mod ffi {
    unsafe extern "C++" {
        type R;

        ///
        unsafe fn my_fn(&self);
    }
}

pub fn public_my_fn(r: &ffi::R) {
    unsafe { r.my_fn() }
}

I expected to see this happen:

warning on empty docs.

Instead, this happened:

nothing.

Version
rustc 1.94.0-nightly (fecb335cb 2026-01-07)
binary: rustc
commit-hash: fecb335cbad3d84ef3da39191ba094e6c726a5b4
commit-date: 2026-01-07
host: x86_64-unknown-linux-gnu
release: 1.94.0-nightly
LLVM version: 21.1.8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.