|
| 1 | +#![feature(rustc_private)] |
| 2 | +#![warn(unused_extern_crates)] |
| 3 | + |
| 4 | +extern crate rustc_ast; |
| 5 | +extern crate rustc_ast_pretty; |
| 6 | +extern crate rustc_data_structures; |
| 7 | +extern crate rustc_errors; |
| 8 | +extern crate rustc_hir; |
| 9 | +extern crate rustc_hir_pretty; |
| 10 | +extern crate rustc_index; |
| 11 | +extern crate rustc_infer; |
| 12 | +extern crate rustc_lexer; |
| 13 | +extern crate rustc_middle; |
| 14 | +extern crate rustc_mir_dataflow; |
| 15 | +extern crate rustc_parse; |
| 16 | +extern crate rustc_parse_format; |
| 17 | +extern crate rustc_span; |
| 18 | +extern crate rustc_target; |
| 19 | +extern crate rustc_trait_selection; |
| 20 | +extern crate rustc_typeck; |
| 21 | + |
| 22 | +use rustc_lint::LateLintPass; |
| 23 | + |
| 24 | +dylint_linting::declare_late_lint! { |
| 25 | + /// **What it does:** |
| 26 | + /// |
| 27 | + /// **Why is this bad?** |
| 28 | + /// |
| 29 | + /// **Known problems:** None. |
| 30 | + /// |
| 31 | + /// **Example:** |
| 32 | + /// |
| 33 | + /// ```rust |
| 34 | + /// // example code where a warning is issued |
| 35 | + /// ``` |
| 36 | + /// Use instead: |
| 37 | + /// ```rust |
| 38 | + /// // example code that does not raise a warning |
| 39 | + /// ``` |
| 40 | + pub DUPLICATE_MUTABLE_ACCOUNTS, |
| 41 | + Warn, |
| 42 | + "description goes here" |
| 43 | +} |
| 44 | + |
| 45 | +impl<'tcx> LateLintPass<'tcx> for DuplicateMutableAccounts { |
| 46 | + // A list of things you might check can be found here: |
| 47 | + // https://doc.rust-lang.org/stable/nightly-rustc/rustc_lint/trait.LateLintPass.html |
| 48 | +} |
| 49 | + |
| 50 | +#[test] |
| 51 | +fn ui() { |
| 52 | + dylint_testing::ui_test( |
| 53 | + env!("CARGO_PKG_NAME"), |
| 54 | + &std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("ui"), |
| 55 | + ); |
| 56 | +} |
0 commit comments