rust/tests/ui/empty_docs.rs

70 lines
972 B
Rust
Raw Normal View History

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