rust/tests/compile-fail/doc.rs
mcarton b1d1f095f1 Improve the DOC_MARKDOWN lint
`_` can be used for emphasize text. `::` is equality as bad outside
ticks.
2016-03-28 21:24:36 +02:00

31 lines
875 B
Rust
Executable file

//! This file tests for the DOC_MARKDOWN lint
//~^ ERROR: you should put `DOC_MARKDOWN` between ticks
#![feature(plugin)]
#![plugin(clippy)]
#![deny(doc_markdown)]
/// The foo_bar function does _nothing_. See also foo::bar. (note the dot there)
/// Markdown is _weird_. I mean _really weird_. This \_ is ok. So is `_`. But not Foo::some_fun
/// which should be reported only once despite being __doubly bad__.
fn foo_bar() {
//~^ ERROR: you should put `foo_bar` between ticks
//~| ERROR: you should put `foo::bar` between ticks
//~| ERROR: you should put `Foo::some_fun` between ticks
}
/// That one tests multiline ticks.
/// ```rust
/// foo_bar FOO_BAR
/// ```
fn multiline_ticks() {
}
/// The `main` function is the entry point of the program. Here it only calls the `foo_bar` and
/// `multiline_ticks` functions.
fn main() {
foo_bar();
multiline_ticks();
}