1 /// This is a test for needless `fn main()` in doctests.
12 /// With an explicit return type it should lint too
36 /// This shouldn't lint, because the `main` is empty:
41 /// This shouldn't lint either, because main is async:
44 /// assert_eq!(42, ANSWER);
48 /// Same here, because the return type is not the unit type:
50 /// fn main() -> Result<()> {
55 /// This shouldn't lint either, because there's a `static`:
57 /// static ANSWER: i32 = 42;
60 /// assert_eq!(42, ANSWER);
64 /// This shouldn't lint either, because there's a `const`:
67 /// assert_eq!(42, ANSWER);
70 /// const ANSWER: i32 = 42;
73 /// Neither should this lint because of `extern crate`:
76 /// extern crate test;
78 /// assert_eq(1u8, test::black_box(1));
82 /// Neither should this lint because it has an extern block:
90 /// This should not lint because there is another function defined:
99 /// We should not lint inside raw strings ...
103 /// unimplemented!();
111 /// // let _inception = 42;
113 /// let _inception = 42;
116 /// We should not lint ignored examples:
119 /// unimplemented!();
123 /// Or even non-rust examples:
126 /// is what starts the program
129 fn no_false_positives() {}
133 no_false_positives();