Closed
Description
If you'd like to fix this bug, here's how!
The follow documentation comment is considered a documentation test. All of the Rust references I have read indicate ``` are needed to indicate a documentation test.
lib.rs
///
/// a
/// b
pub fn some_lib_fn() {
}
Then running cargo test
gives the following output:
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Doc-tests reproduce-doc-test
running 1 test
test src/lib.rs - some_lib_fn (line 1) ... FAILED
failures:
---- src/lib.rs - some_lib_fn (line 1) stdout ----
error[E0425]: cannot find value `a` in this scope
--> src/lib.rs:2:1
|
3 | a
| ^ not found in this scope
thread 'rustc' panicked at 'couldn't compile the test', librustdoc/test.rs:298:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failures:
src/lib.rs - some_lib_fn (line 1)
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
error: test failed, to rerun pass '--doc'
Metadata
Metadata
Assignees
Labels
Area: Documentation for any part of the project, including the compiler, standard library, and toolsCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Medium priority