summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-02-23 04:06:56 +0000
committerbors <bors@rust-lang.org>2022-02-23 04:06:56 +0000
commit9d1b2106e23b1abd32fce1f17267604a5102f57a (patch)
tree460c311a8015d7938ee28c8cd75e72656cbc25c8 /src/tools/clippy/tests/ui
parent3a06854129d1ff7cb1e8a7fb62671782fe2513ba (diff)
parent6bd1b5f2f0d894a2f358701c6254dc459d507ef2 (diff)
downloadrust-1.59.0.tar.gz
rust-1.59.0.zip
Auto merge of #94265 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum 1.59.0
[stable] 1.59.0 artifacts (second round)

This backports (from 1.60, landed in #93001):

*  Move return_self_not_must_use to pedantic rust-lang/rust-clippy#8302

Per a user report on the internals feedback thread, this lint is not behaving well in 1.59.

cc `@rust-lang/clippy` -- this is a stable backport of a patch, which we'll likely want to land in fairly short order to be in time for the release Thursday.

This PR also includes an adjustment to the release notes to reflect "Fix invalid special casing of the unreachable! macro #93179".

r? `@Mark-Simulacrum`
Diffstat (limited to 'src/tools/clippy/tests/ui')
-rw-r--r--src/tools/clippy/tests/ui/return_self_not_must_use.rs1
-rw-r--r--src/tools/clippy/tests/ui/return_self_not_must_use.stderr6
2 files changed, 4 insertions, 3 deletions
diff --git a/src/tools/clippy/tests/ui/return_self_not_must_use.rs b/src/tools/clippy/tests/ui/return_self_not_must_use.rs
index 7dd5742dae9..9b33ad6d3f6 100644
--- a/src/tools/clippy/tests/ui/return_self_not_must_use.rs
+++ b/src/tools/clippy/tests/ui/return_self_not_must_use.rs
@@ -1,4 +1,5 @@
 #![crate_type = "lib"]
+#![warn(clippy::return_self_not_must_use)]
 
 #[derive(Clone)]
 pub struct Bar;
diff --git a/src/tools/clippy/tests/ui/return_self_not_must_use.stderr b/src/tools/clippy/tests/ui/return_self_not_must_use.stderr
index 3793a5559ba..63a365fe080 100644
--- a/src/tools/clippy/tests/ui/return_self_not_must_use.stderr
+++ b/src/tools/clippy/tests/ui/return_self_not_must_use.stderr
@@ -1,5 +1,5 @@
 error: missing `#[must_use]` attribute on a method returning `Self`
-  --> $DIR/return_self_not_must_use.rs:7:5
+  --> $DIR/return_self_not_must_use.rs:8:5
    |
 LL |     fn what(&self) -> Self;
    |     ^^^^^^^^^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL |     fn what(&self) -> Self;
    = note: `-D clippy::return-self-not-must-use` implied by `-D warnings`
 
 error: missing `#[must_use]` attribute on a method returning `Self`
-  --> $DIR/return_self_not_must_use.rs:17:5
+  --> $DIR/return_self_not_must_use.rs:18:5
    |
 LL | /     pub fn foo(&self) -> Self {
 LL | |         Self
@@ -15,7 +15,7 @@ LL | |     }
    | |_____^
 
 error: missing `#[must_use]` attribute on a method returning `Self`
-  --> $DIR/return_self_not_must_use.rs:20:5
+  --> $DIR/return_self_not_must_use.rs:21:5
    |
 LL | /     pub fn bar(self) -> Self {
 LL | |         self