rust-clippy/tests/ui/empty_docs.rs

87 lines
1.2 KiB
Rust
Raw Normal View History

//@aux-build:proc_macro_attr.rs
2024-02-25 05:55:58 +00:00
#![allow(unused)]
#![warn(clippy::empty_docs)]
2024-02-27 10:18:27 +00:00
#![allow(clippy::mixed_attributes_style)]
#![feature(extern_types)]
2024-02-27 10:18:27 +00:00
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
}
mod issue_12377 {
use proc_macro_attr::with_empty_docs;
#[with_empty_docs]
extern "C" {
type Test;
}
#[with_empty_docs]
struct Foo {
a: u8,
}
}