]> git.lizzy.rs Git - rust.git/blob - tests/ui/attrs.rs
32685038067d6e257f4d9a61f16c2c7bcbe47627
[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 #![allow(clippy::missing_docs_in_private_items, clippy::panic, clippy::unreachable)]
7
8 #[inline(always)]
9 fn test_attr_lint() {
10     assert!(true)
11 }
12
13 #[inline(always)]
14 fn false_positive_expr() {
15     unreachable!()
16 }
17
18 #[inline(always)]
19 fn false_positive_stmt() {
20     unreachable!();
21 }
22
23 #[inline(always)]
24 fn empty_and_false_positive_stmt() {
25     unreachable!();
26 }
27
28 #[deprecated(since = "forever")]
29 pub const SOME_CONST: u8 = 42;
30
31 #[deprecated(since = "1")]
32 pub const ANOTHER_CONST: u8 = 23;
33
34 #[deprecated(since = "0.1.1")]
35 pub const YET_ANOTHER_CONST: u8 = 0;
36
37 fn main() {
38     test_attr_lint();
39     if false {
40         false_positive_expr()
41     }
42     if false {
43         false_positive_stmt()
44     }
45     if false {
46         empty_and_false_positive_stmt()
47     }
48 }