Skip to content

Commit c8d89ba

Browse files
committed
Auto merge of #6127 - ebroto:reinstate_forbid_restriction, r=flip1995
Reinstate test for forbid(clippy::restriction) In [this commit](5747c15) coming from rust-lang/rust (#6126) the test for `#![forbid(clippy::restriction)]` was removed because some restriction lints were being allowed after the forbid. This change reinstates the test for `forbid` by using a separate file. changelog: none r? `@flip1995`
2 parents 1a4175b + 6c3611b commit c8d89ba

File tree

4 files changed

+39
-24
lines changed

4 files changed

+39
-24
lines changed

tests/ui/attrs.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#![warn(clippy::inline_always, clippy::deprecated_semver)]
22
#![allow(clippy::assertions_on_constants)]
3-
// Test that the whole restriction group is not enabled
4-
#![warn(clippy::restriction)]
5-
#![deny(clippy::restriction)]
63
#![allow(clippy::missing_docs_in_private_items, clippy::panic, clippy::unreachable)]
74

85
#[inline(always)]

tests/ui/attrs.stderr

+4-21
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,24 @@
11
error: you have declared `#[inline(always)]` on `test_attr_lint`. This is usually a bad idea
2-
--> $DIR/attrs.rs:8:1
2+
--> $DIR/attrs.rs:5:1
33
|
44
LL | #[inline(always)]
55
| ^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::inline-always` implied by `-D warnings`
88

99
error: the since field must contain a semver-compliant version
10-
--> $DIR/attrs.rs:28:14
10+
--> $DIR/attrs.rs:25:14
1111
|
1212
LL | #[deprecated(since = "forever")]
1313
| ^^^^^^^^^^^^^^^^^
1414
|
1515
= note: `-D clippy::deprecated-semver` implied by `-D warnings`
1616

1717
error: the since field must contain a semver-compliant version
18-
--> $DIR/attrs.rs:31:14
18+
--> $DIR/attrs.rs:28:14
1919
|
2020
LL | #[deprecated(since = "1")]
2121
| ^^^^^^^^^^^
2222

23-
error: restriction lints are not meant to be all enabled
24-
--> $DIR/attrs.rs:4:9
25-
|
26-
LL | #![warn(clippy::restriction)]
27-
| ^^^^^^^^^^^^^^^^^^^
28-
|
29-
= note: `-D clippy::blanket-clippy-restriction-lints` implied by `-D warnings`
30-
= help: try enabling only the lints you really need
31-
32-
error: restriction lints are not meant to be all enabled
33-
--> $DIR/attrs.rs:5:9
34-
|
35-
LL | #![deny(clippy::restriction)]
36-
| ^^^^^^^^^^^^^^^^^^^
37-
|
38-
= help: try enabling only the lints you really need
39-
40-
error: aborting due to 5 previous errors
23+
error: aborting due to 3 previous errors
4124

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![warn(clippy::blanket_clippy_restriction_lints)]
2+
3+
//! Test that the whole restriction group is not enabled
4+
#![warn(clippy::restriction)]
5+
#![deny(clippy::restriction)]
6+
#![forbid(clippy::restriction)]
7+
8+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
error: restriction lints are not meant to be all enabled
2+
--> $DIR/blanket_clippy_restriction_lints.rs:4:9
3+
|
4+
LL | #![warn(clippy::restriction)]
5+
| ^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: `-D clippy::blanket-clippy-restriction-lints` implied by `-D warnings`
8+
= help: try enabling only the lints you really need
9+
10+
error: restriction lints are not meant to be all enabled
11+
--> $DIR/blanket_clippy_restriction_lints.rs:5:9
12+
|
13+
LL | #![deny(clippy::restriction)]
14+
| ^^^^^^^^^^^^^^^^^^^
15+
|
16+
= help: try enabling only the lints you really need
17+
18+
error: restriction lints are not meant to be all enabled
19+
--> $DIR/blanket_clippy_restriction_lints.rs:6:11
20+
|
21+
LL | #![forbid(clippy::restriction)]
22+
| ^^^^^^^^^^^^^^^^^^^
23+
|
24+
= help: try enabling only the lints you really need
25+
26+
error: aborting due to 3 previous errors
27+

0 commit comments

Comments
 (0)