fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.9 KiB85 linesraw
1//@aux-build:proc_macro_derive.rs
2
3#![allow(unused)]
4#![warn(clippy::useless_attribute)]
5#![warn(unreachable_pub)]
6#![feature(rustc_private)]
7
8#![allow(dead_code)]
9#![cfg_attr(feature = "cargo-clippy", allow(dead_code))]
10#[rustfmt::skip]
11#[allow(unused_imports)]
12#[allow(unused_extern_crates)]
13#[macro_use]
14extern crate rustc_middle;
15
16#[macro_use]
17extern crate proc_macro_derive;
18
19fn test_indented_attr() {
20    #![allow(clippy::almost_swapped)]
21    use std::collections::HashSet;
22
23    let _ = HashSet::<u32>::default();
24}
25
26// don't lint on unused_import for `use` items
27#[allow(unused_imports)]
28use std::collections;
29
30// don't lint on unused for `use` items
31#[allow(unused)]
32use std::option;
33
34// don't lint on deprecated for `use` items
35mod foo {
36    #[deprecated]
37    pub struct Bar;
38}
39#[allow(deprecated)]
40pub use foo::Bar;
41
42// This should not trigger the lint. There's lint level definitions inside the external derive
43// that would trigger the useless_attribute lint.
44#[derive(DeriveSomething)]
45struct Baz;
46
47// don't lint on unreachable_pub for `use` items
48mod a {
49    mod b {
50        #[allow(dead_code)]
51        #[allow(unreachable_pub)]
52        pub struct C;
53    }
54
55    #[allow(unreachable_pub)]
56    pub use self::b::C;
57}
58
59// don't lint on clippy::wildcard_imports for `use` items
60#[allow(clippy::wildcard_imports)]
61pub use std::io::prelude::*;
62
63// don't lint on clippy::enum_glob_use for `use` items
64#[allow(clippy::enum_glob_use)]
65pub use std::cmp::Ordering::*;
66
67// don't lint on clippy::redundant_pub_crate
68mod c {
69    #[allow(clippy::redundant_pub_crate)]
70    pub(crate) struct S;
71}
72
73// https://github.com/rust-lang/rust-clippy/issues/7511
74pub mod split {
75    #[allow(clippy::module_name_repetitions)]
76    pub use regex::SplitN;
77}
78
79// https://github.com/rust-lang/rust-clippy/issues/8768
80#[allow(clippy::single_component_path_imports)]
81use regex;
82
83fn main() {
84    test_indented_attr();
85}