rust-lang / rust-lang/rust

`doc(rust_logo)` is improperly feature gated

Open
#161,984 3 comments 0 reactions 1 assignee View on GitHub

@mejrs is already working on this.

Since Sep 3, 2026.

A-attributes C-bug T-compiler T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I tried this code:

#[doc(rust_logo)]
struct Foo;

I expected to see this happen: doc(rust_logo) is unstable, so compile error since no feature is used.

Instead, this happened:

warning: this attribute can only be applied at the crate level
 --> src/lib.rs:1:7
  |
1 | #[doc(rust_logo)]
  |       ^^^^^^^^^
  |
  = note: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
  = note: `#[warn(invalid_doc_attributes)]` on by default
Meta

rustc --version --verbose:

Rust 1.0.0 and up

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.