8
8
//! Thank you!
9
9
//! ~The `INTERNAL_METADATA_COLLECTOR` lint
10
10
11
- use rustc_errors:: { Applicability , DiagnosticBuilder } ;
11
+ use rustc_errors:: { Applicability , Diagnostic } ;
12
12
use rustc_hir:: HirId ;
13
13
use rustc_lint:: { LateContext , Lint , LintContext } ;
14
14
use rustc_span:: source_map:: { MultiSpan , Span } ;
15
15
use std:: env;
16
16
17
- fn docs_link ( diag : & mut DiagnosticBuilder < ' _ > , lint : & ' static Lint ) {
17
+ fn docs_link ( diag : & mut Diagnostic , lint : & ' static Lint ) {
18
18
if env:: var ( "CLIPPY_DISABLE_DOCS_LINKS" ) . is_err ( ) {
19
19
if let Some ( lint) = lint. name_lower ( ) . strip_prefix ( "clippy::" ) {
20
20
diag. help ( & format ! (
@@ -145,7 +145,7 @@ pub fn span_lint_and_then<C, S, F>(cx: &C, lint: &'static Lint, sp: S, msg: &str
145
145
where
146
146
C : LintContext ,
147
147
S : Into < MultiSpan > ,
148
- F : FnOnce ( & mut DiagnosticBuilder < ' _ > ) ,
148
+ F : FnOnce ( & mut Diagnostic ) ,
149
149
{
150
150
cx. struct_span_lint ( lint, sp, |diag| {
151
151
let mut diag = diag. build ( msg) ;
@@ -169,7 +169,7 @@ pub fn span_lint_hir_and_then(
169
169
hir_id : HirId ,
170
170
sp : impl Into < MultiSpan > ,
171
171
msg : & str ,
172
- f : impl FnOnce ( & mut DiagnosticBuilder < ' _ > ) ,
172
+ f : impl FnOnce ( & mut Diagnostic ) ,
173
173
) {
174
174
cx. tcx . struct_span_lint_hir ( lint, hir_id, sp, |diag| {
175
175
let mut diag = diag. build ( msg) ;
@@ -219,7 +219,7 @@ pub fn span_lint_and_sugg<'a, T: LintContext>(
219
219
/// appear once per
220
220
/// replacement. In human-readable format though, it only appears once before
221
221
/// the whole suggestion.
222
- pub fn multispan_sugg < I > ( diag : & mut DiagnosticBuilder < ' _ > , help_msg : & str , sugg : I )
222
+ pub fn multispan_sugg < I > ( diag : & mut Diagnostic , help_msg : & str , sugg : I )
223
223
where
224
224
I : IntoIterator < Item = ( Span , String ) > ,
225
225
{
@@ -232,7 +232,7 @@ where
232
232
/// multiple spans. This is tracked in issue [rustfix#141](https://github.com/rust-lang/rustfix/issues/141).
233
233
/// Suggestions with multiple spans will be silently ignored.
234
234
pub fn multispan_sugg_with_applicability < I > (
235
- diag : & mut DiagnosticBuilder < ' _ > ,
235
+ diag : & mut Diagnostic ,
236
236
help_msg : & str ,
237
237
applicability : Applicability ,
238
238
sugg : I ,
0 commit comments