rust-analyzer version: 0.3.3041
rustc version: rustc 1.98.0 (88d9e12ae 2026-08-18)
editor or extension: VSCode
relevant settings: none
code snippet to reproduce:
///```
///assert!(true); // This does have a doctest
///```
trait Trait {
///```
///assert!(true); // This does not
///```
fn method(&self);
}
The first doc-test has a Run Doctest lens while the second has none.
cargo test --doc correctly finds both doctests and runs them:
running 2 tests
test src/lib.rs - Trait::method (line 5) ... ok
test src/lib.rs - Trait (line 1) ... ok
Example image
rust-analyzer version:
0.3.3041rustc version:
rustc 1.98.0 (88d9e12ae 2026-08-18)editor or extension: VSCode
relevant settings: none
code snippet to reproduce:
The first doc-test has a
Run Doctestlens while the second has none.cargo test --doccorrectly finds both doctests and runs them:Example image