summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui-internal/disallow_struct_span_lint.rs
blob: 3155c0235ffd071dd5188dd1d2d5555a00c5eb67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#![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>) {
    cx.struct_span_lint(lint, span, msg, |b| b);
}

pub fn b(
    tcx: TyCtxt<'_>,
    lint: &'static Lint,
    hir_id: HirId,
    span: impl Into<MultiSpan>,
    msg: impl Into<DiagnosticMessage>,
) {
    tcx.struct_span_lint_hir(lint, hir_id, span, msg, |b| b);
}

fn main() {}