rust-lang / rust-lang/rust

`rustc_has_incoherent_impl` breaks rustdoc in subtle ways

Open
#161,699 7 comments 0 reactions 1 assignee View on GitHub

@clarfonthey is already working on this.

Since Aug 27, 2026.

C-bug I-prioritize needs-triage regression-untriaged S-has-bisection T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Code

I tried this code:

/// [`std::io::Error::last_os_error`]
pub struct Strukt;

I expected to see this happen: cargo doc finishes without warnings.

Instead, this happened:

warning: unresolved link to `std::io::Error::last_os_error`
 --> dep/src/lib.rs:3:7
  |
3 | /// [`std::io::Error::last_os_error`].
  |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the struct `Error` has no field or associated item named `last_os_error`
  |
  = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

warning: `dep` (lib doc) generated 1 warning
Version it worked on

It most recently worked on: 1.97

Version with regression

rustc --version --verbose:

rustc 1.98.0 (88d9e12ae 2026-08-18)
binary: rustc
commit-hash: 88d9e12ae178fab0fb5cc050a94da85685d449ea
commit-date: 2026-08-18
host: x86_64-unknown-linux-gnu
release: 1.98.0
LLVM version: 22.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.