mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 05:03:21 +00:00
21 lines
625 B
Rust
21 lines
625 B
Rust
#![feature(rustc_private)]
|
|
|
|
extern crate rustc_errors;
|
|
extern crate rustc_hir;
|
|
extern crate rustc_lint;
|
|
extern crate rustc_middle;
|
|
|
|
use rustc_errors::{DiagMessage, MultiSpan};
|
|
use rustc_hir::hir_id::HirId;
|
|
use rustc_lint::{Lint, LintContext};
|
|
use rustc_middle::ty::TyCtxt;
|
|
|
|
pub fn a(cx: impl LintContext, lint: &'static Lint, span: impl Into<MultiSpan>, msg: impl Into<DiagMessage>) {
|
|
cx.span_lint(lint, span, msg, |_| {});
|
|
}
|
|
|
|
pub fn b(tcx: TyCtxt<'_>, lint: &'static Lint, hir_id: HirId, span: impl Into<MultiSpan>, msg: impl Into<DiagMessage>) {
|
|
tcx.node_span_lint(lint, hir_id, span, msg, |_| {});
|
|
}
|
|
|
|
fn main() {}
|