@@ -80,6 +80,7 @@ impl<'source> Into<FluentValue<'source>> for DiagnosticArgValue<'source> {
80
80
81
81
/// Trait implemented by error types. This should not be implemented manually. Instead, use
82
82
/// `#[derive(SessionSubdiagnostic)]` -- see [rustc_macros::SessionSubdiagnostic].
83
+ #[ rustc_diagnostic_item = "AddSubdiagnostic" ]
83
84
pub trait AddSubdiagnostic {
84
85
/// Add a subdiagnostic to an existing diagnostic.
85
86
fn add_to_diagnostic ( self , diag : & mut Diagnostic ) ;
@@ -283,6 +284,7 @@ impl Diagnostic {
283
284
///
284
285
/// This span is *not* considered a ["primary span"][`MultiSpan`]; only
285
286
/// the `Span` supplied when creating the diagnostic is primary.
287
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
286
288
pub fn span_label ( & mut self , span : Span , label : impl Into < SubdiagnosticMessage > ) -> & mut Self {
287
289
self . span . push_span_label ( span, self . subdiagnostic_message_to_diagnostic_message ( label) ) ;
288
290
self
@@ -401,6 +403,7 @@ impl Diagnostic {
401
403
}
402
404
403
405
/// Add a note attached to this diagnostic.
406
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
404
407
pub fn note ( & mut self , msg : impl Into < SubdiagnosticMessage > ) -> & mut Self {
405
408
self . sub ( Level :: Note , msg, MultiSpan :: new ( ) , None ) ;
406
409
self
@@ -423,6 +426,7 @@ impl Diagnostic {
423
426
424
427
/// Prints the span with a note above it.
425
428
/// This is like [`Diagnostic::note()`], but it gets its own span.
429
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
426
430
pub fn span_note < S : Into < MultiSpan > > (
427
431
& mut self ,
428
432
sp : S ,
@@ -444,13 +448,15 @@ impl Diagnostic {
444
448
}
445
449
446
450
/// Add a warning attached to this diagnostic.
451
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
447
452
pub fn warn ( & mut self , msg : impl Into < SubdiagnosticMessage > ) -> & mut Self {
448
453
self . sub ( Level :: Warning , msg, MultiSpan :: new ( ) , None ) ;
449
454
self
450
455
}
451
456
452
457
/// Prints the span with a warning above it.
453
458
/// This is like [`Diagnostic::warn()`], but it gets its own span.
459
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
454
460
pub fn span_warn < S : Into < MultiSpan > > (
455
461
& mut self ,
456
462
sp : S ,
@@ -461,6 +467,7 @@ impl Diagnostic {
461
467
}
462
468
463
469
/// Add a help message attached to this diagnostic.
470
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
464
471
pub fn help ( & mut self , msg : impl Into < SubdiagnosticMessage > ) -> & mut Self {
465
472
self . sub ( Level :: Help , msg, MultiSpan :: new ( ) , None ) ;
466
473
self
@@ -474,6 +481,7 @@ impl Diagnostic {
474
481
475
482
/// Prints the span with some help above it.
476
483
/// This is like [`Diagnostic::help()`], but it gets its own span.
484
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
477
485
pub fn span_help < S : Into < MultiSpan > > (
478
486
& mut self ,
479
487
sp : S ,
0 commit comments