diff options
| author | bors <bors@rust-lang.org> | 2022-11-30 12:44:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-11-30 12:44:45 +0000 |
| commit | 78589ffad2c973f7863fdabc2df6e8ab2b54110f (patch) | |
| tree | bdaf1f92e8bb00a6c7b5c6338bf7fd42649d2fb3 /tests/ui | |
| parent | 3cf2c17e53d115bd8c233a268c0d0ff0fbb2395e (diff) | |
| parent | cc43c3d25d4c0a6cf3dc3df7d5b560656c652bab (diff) | |
| download | rust-78589ffad2c973f7863fdabc2df6e8ab2b54110f.tar.gz rust-78589ffad2c973f7863fdabc2df6e8ab2b54110f.zip | |
Auto merge of #9989 - xFrednet:9986-move-safety-thingy, r=flip1995
Move `unnecessary_unsafety_doc` to `pedantic` This lint was added in #9822. I like the idea, but also agree with #9986 as well. I think it should at least not be warn-by-default. This is one of these cases, where I'd like a group between pedantic and restriction. But I believe that users using `#![warn(clippy::pedantic)]` will know how to enable the lint if they disagree with it. --- Since the lint is new: changelog: none r? `@flip1995` since I'd suggest back porting this, the original PR was merged 16 days ago. Closes: #9986 (While it doesn't address everything, I believe that this is the best compromise)
Diffstat (limited to 'tests/ui')
| -rw-r--r-- | tests/ui/unnecessary_unsafety_doc.rs (renamed from tests/ui/doc_unnecessary_unsafe.rs) | 1 | ||||
| -rw-r--r-- | tests/ui/unnecessary_unsafety_doc.stderr (renamed from tests/ui/doc_unnecessary_unsafe.stderr) | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/tests/ui/doc_unnecessary_unsafe.rs b/tests/ui/unnecessary_unsafety_doc.rs index d9e9363b0f4..c160e31afd3 100644 --- a/tests/ui/doc_unnecessary_unsafe.rs +++ b/tests/ui/unnecessary_unsafety_doc.rs @@ -1,6 +1,7 @@ // aux-build:doc_unsafe_macros.rs #![allow(clippy::let_unit_value)] +#![warn(clippy::unnecessary_safety_doc)] #[macro_use] extern crate doc_unsafe_macros; diff --git a/tests/ui/doc_unnecessary_unsafe.stderr b/tests/ui/unnecessary_unsafety_doc.stderr index 83b2efbb346..72898c93fa1 100644 --- a/tests/ui/doc_unnecessary_unsafe.stderr +++ b/tests/ui/unnecessary_unsafety_doc.stderr @@ -1,5 +1,5 @@ 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 ()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,31 +7,31 @@ LL | pub fn apocalypse(universe: &mut ()) { = note: `-D clippy::unnecessary-safety-doc` implied by `-D warnings` 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() { | ^^^^^^^^^^^^^^^^^^^^ 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); | ^^^^^^^^^^^^^^^^^^^^ 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 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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() { | ^^^^^^^^^^^^^^ @@ -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) 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 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
