Skip to content

fix: include all lifetimes in doctest runnable filters - #22848

Open
AayushMainali-Github wants to merge 1 commit into
rust-lang:masterfrom
AayushMainali-Github:fix/22830-doctest-multiple-lifetimes
Open

fix: include all lifetimes in doctest runnable filters#22848
AayushMainali-Github wants to merge 1 commit into
rust-lang:masterfrom
AayushMainali-Github:fix/22830-doctest-multiple-lifetimes

Conversation

@AayushMainali-Github

@AayushMainali-Github AayushMainali-Github commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #22830

Doctest runnable filters for associated items only included the first lifetime parameter of the implementing ADT. For types with multiple lifetimes, that produced filters like Foo<'a>::method while rustc names the doctest Foo<'a,'b>::method, so "Run Doctest" ran 0 tests.

Collect all early-bound lifetimes in Adt::lifetimes / Type::generic_parameters so the generated filter matches rustc.

Test plan

  • cargo test -p ide --lib runnables::
  • cargo test -p ide-diagnostics --lib unresolved_method
  • cargo clippy -p hir -p ide --lib -- -D warnings

AI disclosure: Assisted by Cursor (Grok).

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 18, 2026
@ChayimFriedman2

Copy link
Copy Markdown
Contributor

Please note that our AI policy disallows using AI to write GitHub comments, including PR descriptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doctests can't be triggered for methods of structs with multiple lifetimes

3 participants