2023-11-16 12:13:24 -06:00
|
|
|
#![feature(rustc_private)]
|
|
|
|
|
|
|
|
extern crate rustc_errors;
|
|
|
|
extern crate rustc_hir;
|
|
|
|
extern crate rustc_lint;
|
|
|
|
extern crate rustc_middle;
|
|
|
|
|
2024-02-28 18:58:51 -06:00
|
|
|
use rustc_errors::{DiagMessage, MultiSpan};
|
2023-11-16 12:13:24 -06:00
|
|
|
use rustc_hir::hir_id::HirId;
|
|
|
|
use rustc_lint::{Lint, LintContext};
|
|
|
|
use rustc_middle::ty::TyCtxt;
|
|
|
|
|
2024-03-07 10:19:29 -06:00
|
|
|
pub fn a(cx: impl LintContext, lint: &'static Lint, span: impl Into<MultiSpan>, msg: impl Into<DiagMessage>) {
|
2024-05-30 02:44:14 -05:00
|
|
|
cx.span_lint(lint, span, |lint| {
|
|
|
|
lint.primary_message(msg);
|
|
|
|
});
|
2023-11-16 12:13:24 -06:00
|
|
|
}
|
|
|
|
|
2024-03-07 10:19:29 -06:00
|
|
|
pub fn b(tcx: TyCtxt<'_>, lint: &'static Lint, hir_id: HirId, span: impl Into<MultiSpan>, msg: impl Into<DiagMessage>) {
|
2024-05-30 02:44:14 -05:00
|
|
|
tcx.node_span_lint(lint, hir_id, span, |lint| {
|
|
|
|
lint.primary_message(msg);
|
|
|
|
});
|
2023-11-16 12:13:24 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|