/// # Examples
///
/// ```
/// use std::path::PathBuf;
/// use std::vec;
///
/// fn main() {
/// }
///
/// ```
fn main() {
println!("Hello, world!");
}
It looks like the lint assumes the fn main()
will always be in the first line of the code block..?
warning: needless `fn main` in doctest
--> src/main.rs:4:4
|
4 | /// use std::path::PathBuf;
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(clippy::needless_doctest_main)]` on by default
This causes strange looking warnings.
clippy 0.0.212 (fc5d0cc 2020-02-24)