rust/tests/ui/lint_pass.rs

26 lines
433 B
Rust
Raw Normal View History

2017-09-18 05:47:33 -05:00
#![feature(rustc_private)]
#![feature(macro_vis_matcher)]
2017-09-18 05:47:33 -05:00
#![warn(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" }
2017-02-08 07:58:07 -06:00
pub struct Pass;
impl LintPass for Pass {
fn get_lints(&self) -> LintArray {
lint_array![GOOD_LINT]
}
}
fn main() {
let _ = MISSING_LINT;
}