Move unnecessary_unsafety_doc
to pedantic
This commit is contained in:
parent
12074808c7
commit
cc43c3d25d
3 changed files with 9 additions and 8 deletions
|
@ -253,7 +253,7 @@ declare_clippy_lint! {
|
||||||
/// ```
|
/// ```
|
||||||
#[clippy::version = "1.66.0"]
|
#[clippy::version = "1.66.0"]
|
||||||
pub UNNECESSARY_SAFETY_DOC,
|
pub UNNECESSARY_SAFETY_DOC,
|
||||||
style,
|
restriction,
|
||||||
"`pub fn` or `pub trait` with `# Safety` docs"
|
"`pub fn` or `pub trait` with `# Safety` docs"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// aux-build:doc_unsafe_macros.rs
|
// aux-build:doc_unsafe_macros.rs
|
||||||
|
|
||||||
#![allow(clippy::let_unit_value)]
|
#![allow(clippy::let_unit_value)]
|
||||||
|
#![warn(clippy::unnecessary_safety_doc)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate doc_unsafe_macros;
|
extern crate doc_unsafe_macros;
|
|
@ -1,5 +1,5 @@
|
||||||
error: safe function's docs have unnecessary `# Safety` section
|
error: safe function's docs have unnecessary `# Safety` section
|
||||||
--> $DIR/doc_unnecessary_unsafe.rs:18:1
|
--> $DIR/unnecessary_unsafety_doc.rs:19:1
|
||||||
|
|
|
|
||||||
LL | pub fn apocalypse(universe: &mut ()) {
|
LL | pub fn apocalypse(universe: &mut ()) {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
@ -7,31 +7,31 @@ LL | pub fn apocalypse(universe: &mut ()) {
|
||||||
= note: `-D clippy::unnecessary-safety-doc` implied by `-D warnings`
|
= note: `-D clippy::unnecessary-safety-doc` implied by `-D warnings`
|
||||||
|
|
||||||
error: safe function's docs have unnecessary `# Safety` section
|
error: safe function's docs have unnecessary `# Safety` section
|
||||||
--> $DIR/doc_unnecessary_unsafe.rs:44:5
|
--> $DIR/unnecessary_unsafety_doc.rs:45:5
|
||||||
|
|
|
|
||||||
LL | pub fn republished() {
|
LL | pub fn republished() {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: safe function's docs have unnecessary `# Safety` section
|
error: safe function's docs have unnecessary `# Safety` section
|
||||||
--> $DIR/doc_unnecessary_unsafe.rs:57:5
|
--> $DIR/unnecessary_unsafety_doc.rs:58:5
|
||||||
|
|
|
|
||||||
LL | fn documented(self);
|
LL | fn documented(self);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: docs for safe trait have unnecessary `# Safety` section
|
error: docs for safe trait have unnecessary `# Safety` section
|
||||||
--> $DIR/doc_unnecessary_unsafe.rs:67:1
|
--> $DIR/unnecessary_unsafety_doc.rs:68:1
|
||||||
|
|
|
|
||||||
LL | pub trait DocumentedSafeTrait {
|
LL | pub trait DocumentedSafeTrait {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: safe function's docs have unnecessary `# Safety` section
|
error: safe function's docs have unnecessary `# Safety` section
|
||||||
--> $DIR/doc_unnecessary_unsafe.rs:95:5
|
--> $DIR/unnecessary_unsafety_doc.rs:96:5
|
||||||
|
|
|
|
||||||
LL | pub fn documented() -> Self {
|
LL | pub fn documented() -> Self {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: safe function's docs have unnecessary `# Safety` section
|
error: safe function's docs have unnecessary `# Safety` section
|
||||||
--> $DIR/doc_unnecessary_unsafe.rs:122:9
|
--> $DIR/unnecessary_unsafety_doc.rs:123:9
|
||||||
|
|
|
|
||||||
LL | pub fn drive() {
|
LL | pub fn drive() {
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
@ -42,7 +42,7 @@ LL | very_safe!();
|
||||||
= note: this error originates in the macro `very_safe` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the macro `very_safe` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
error: docs for safe trait have unnecessary `# Safety` section
|
error: docs for safe trait have unnecessary `# Safety` section
|
||||||
--> $DIR/doc_unnecessary_unsafe.rs:146:1
|
--> $DIR/unnecessary_unsafety_doc.rs:147:1
|
||||||
|
|
|
|
||||||
LL | pub trait DocumentedSafeTraitWithImplementationHeader {
|
LL | pub trait DocumentedSafeTraitWithImplementationHeader {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
Loading…
Add table
Add a link
Reference in a new issue