rust-clippy/tests/ui/empty_docs.rs

68 lines
929 B
Rust
Raw Normal View History

2024-02-25 05:55:58 +00:00
#![allow(unused)]
#![warn(clippy::empty_docs)]
2024-02-25 18:33:16 +00:00
mod outer {
//!
2024-02-25 05:55:58 +00:00
2024-02-25 18:33:16 +00:00
/// this is a struct
struct Bananas {
/// count
count: usize,
}
2024-02-25 05:55:58 +00:00
///
2024-02-25 18:33:16 +00:00
enum Warn {
///
A,
B,
}
2024-02-25 05:55:58 +00:00
2024-02-25 18:33:16 +00:00
enum DontWarn {
/// i
A,
B,
}
2024-02-25 12:11:14 +00:00
2024-02-25 18:33:16 +00:00
#[doc = ""]
fn warn_about_this() {}
2024-02-25 05:55:58 +00:00
2024-02-25 18:33:16 +00:00
#[doc = ""]
#[doc = ""]
fn this_doesn_warn() {}
2024-02-25 05:55:58 +00:00
2024-02-25 18:33:16 +00:00
#[doc = "a fine function"]
fn this_is_fine() {}
2024-02-25 12:11:14 +00:00
2024-02-25 18:33:16 +00:00
///
mod inner {
///
fn dont_warn_inner_outer() {
//!w
}
2024-02-25 05:55:58 +00:00
2024-02-25 18:33:16 +00:00
fn this_is_ok() {
//!
//! inside the function
}
2024-02-25 05:55:58 +00:00
2024-02-25 18:33:16 +00:00
fn warn() {
/*! */
}
2024-02-25 12:11:14 +00:00
2024-02-25 18:33:16 +00:00
fn dont_warn() {
/*! dont warn me */
}
2024-02-25 05:55:58 +00:00
2024-02-25 18:33:16 +00:00
trait NoDoc {
///
fn some() {}
}
}
2024-02-25 12:11:14 +00:00
2024-02-25 18:33:16 +00:00
union Unite {
/// lint y
x: i32,
///
y: i32,
}
2024-02-25 05:55:58 +00:00
}