mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
5f09020e90
Four lints were missing from LintPass, making them unavailable unless the `clippy` lint group is explicitly enabled: * `for_loop_over_result` * `for_loop_over_option` * `match_overlapping_arm` * `filter_next`
27 lines
508 B
Rust
27 lines
508 B
Rust
#![feature(plugin)]
|
|
#![feature(rustc_private)]
|
|
#![plugin(clippy)]
|
|
|
|
#![deny(lint_without_lint_pass)]
|
|
|
|
#[macro_use] extern crate rustc;
|
|
|
|
use rustc::lint::{LintPass, LintArray};
|
|
|
|
declare_lint! { GOOD_LINT, Warn, "good lint" }
|
|
declare_lint! { MISSING_LINT, Warn, "missing lint" }
|
|
//~^ ERROR: the lint `MISSING_LINT` is not added to any `LintPass`
|
|
|
|
pub struct Pass;
|
|
|
|
impl LintPass for Pass {
|
|
fn get_lints(&self) -> LintArray {
|
|
lint_array![GOOD_LINT]
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let _ = MISSING_LINT;
|
|
}
|
|
|
|
|