Closed
Description
Example code for src/lib.rs
:
//! This is a doc comment
//!
//! ```rust
//! fn main() {}
//! ```
//!
//! With a trailing code fence
//! ```
/// Some foo function
fn foo() {}
Running doc tests on beta or nightly panics, while stable is ok with that:
$ cargo +beta test --doc
Compiling lol v0.1.0 (file:///home/levans/test/lol)
warning: function is never used: `foo`
--> src/lib.rs:12:1
|
12 | fn foo() {}
| ^^^^^^^^
|
= note: #[warn(dead_code)] on by default
Finished dev [unoptimized + debuginfo] target(s) in 0.19 secs
Doc-tests lol
thread '<unnamed>' panicked at 'begin <= end (44 <= 0) when slicing `This is a doc comment
```rust
fn main() {}
```
With a trailing code fence
````', libcore/str/mod.rs:2225:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: test failed, to rerun pass '--doc'