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;
|
|
|
|
|
|
|
|
use rustc_errors::{DiagnosticMessage, 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<DiagnosticMessage>) {
|
2023-12-28 12:33:07 -06:00
|
|
|
cx.struct_span_lint(lint, span, msg, |_| {});
|
2023-11-16 12:13:24 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn b(
|
|
|
|
tcx: TyCtxt<'_>,
|
|
|
|
lint: &'static Lint,
|
|
|
|
hir_id: HirId,
|
|
|
|
span: impl Into<MultiSpan>,
|
|
|
|
msg: impl Into<DiagnosticMessage>,
|
|
|
|
) {
|
2023-12-28 12:33:07 -06:00
|
|
|
tcx.struct_span_lint_hir(lint, hir_id, span, msg, |_| {});
|
2023-11-16 12:13:24 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|