Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

needless_doctest_main triggers inside of multiline strings #5879

Closed
udoprog opened this issue Aug 8, 2020 · 1 comment · Fixed by #5912
Closed

needless_doctest_main triggers inside of multiline strings #5879

udoprog opened this issue Aug 8, 2020 · 1 comment · Fixed by #5912
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@udoprog
Copy link

udoprog commented Aug 8, 2020

The lint triggers for fn main()'s inside of multiline strings, like these:

/// ```
/// let string = r#"
/// fn main() {
///     // things
/// }
/// "#;
/// ```
fn my_documented_function() {
}

With:

warning: needless `fn main` in doctest
  --> crates\rune\src\ast\decl_file.rs:40:4
   |
40 | /// let string = r#"
   |    ^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(clippy::needless_doctest_main)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
@udoprog udoprog added the C-bug Category: Clippy is not doing the correct thing label Aug 8, 2020
@ebroto
Copy link
Member

ebroto commented Aug 15, 2020

I'm working on this, I think I'll have a PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants