]> git.lizzy.rs Git - rust.git/blob - tests/ui/attrs.rs
Auto merge of #5980 - matsujika:create-dir, r=flip1995
[rust.git] / tests / ui / attrs.rs
1 #![warn(clippy::inline_always, clippy::deprecated_semver)]
2 #![allow(clippy::assertions_on_constants)]
3 // Test that the whole restriction group is not enabled
4 #![warn(clippy::restriction)]
5 #![deny(clippy::restriction)]
6 #![forbid(clippy::restriction)]
7 #![allow(clippy::missing_docs_in_private_items, clippy::panic, clippy::unreachable)]
8
9 #[inline(always)]
10 fn test_attr_lint() {
11     assert!(true)
12 }
13
14 #[inline(always)]
15 fn false_positive_expr() {
16     unreachable!()
17 }
18
19 #[inline(always)]
20 fn false_positive_stmt() {
21     unreachable!();
22 }
23
24 #[inline(always)]
25 fn empty_and_false_positive_stmt() {
26     unreachable!();
27 }
28
29 #[deprecated(since = "forever")]
30 pub const SOME_CONST: u8 = 42;
31
32 #[deprecated(since = "1")]
33 pub const ANOTHER_CONST: u8 = 23;
34
35 #[deprecated(since = "0.1.1")]
36 pub const YET_ANOTHER_CONST: u8 = 0;
37
38 fn main() {
39     test_attr_lint();
40     if false {
41         false_positive_expr()
42     }
43     if false {
44         false_positive_stmt()
45     }
46     if false {
47         empty_and_false_positive_stmt()
48     }
49 }