@@ -280,13 +280,15 @@ impl Session {
280280 self . crate_types . set ( crate_types) . expect ( "`crate_types` was initialized twice" )
281281 }
282282
283+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
283284 pub fn struct_span_warn < S : Into < MultiSpan > > (
284285 & self ,
285286 sp : S ,
286287 msg : impl Into < DiagnosticMessage > ,
287288 ) -> DiagnosticBuilder < ' _ , ( ) > {
288289 self . diagnostic ( ) . struct_span_warn ( sp, msg)
289290 }
291+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
290292 pub fn struct_span_warn_with_expectation < S : Into < MultiSpan > > (
291293 & self ,
292294 sp : S ,
@@ -295,6 +297,7 @@ impl Session {
295297 ) -> DiagnosticBuilder < ' _ , ( ) > {
296298 self . diagnostic ( ) . struct_span_warn_with_expectation ( sp, msg, id)
297299 }
300+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
298301 pub fn struct_span_warn_with_code < S : Into < MultiSpan > > (
299302 & self ,
300303 sp : S ,
@@ -303,40 +306,47 @@ impl Session {
303306 ) -> DiagnosticBuilder < ' _ , ( ) > {
304307 self . diagnostic ( ) . struct_span_warn_with_code ( sp, msg, code)
305308 }
309+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
306310 pub fn struct_warn ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , ( ) > {
307311 self . diagnostic ( ) . struct_warn ( msg)
308312 }
313+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
309314 pub fn struct_warn_with_expectation (
310315 & self ,
311316 msg : impl Into < DiagnosticMessage > ,
312317 id : lint:: LintExpectationId ,
313318 ) -> DiagnosticBuilder < ' _ , ( ) > {
314319 self . diagnostic ( ) . struct_warn_with_expectation ( msg, id)
315320 }
321+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
316322 pub fn struct_span_allow < S : Into < MultiSpan > > (
317323 & self ,
318324 sp : S ,
319325 msg : impl Into < DiagnosticMessage > ,
320326 ) -> DiagnosticBuilder < ' _ , ( ) > {
321327 self . diagnostic ( ) . struct_span_allow ( sp, msg)
322328 }
329+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
323330 pub fn struct_allow ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , ( ) > {
324331 self . diagnostic ( ) . struct_allow ( msg)
325332 }
333+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
326334 pub fn struct_expect (
327335 & self ,
328336 msg : impl Into < DiagnosticMessage > ,
329337 id : lint:: LintExpectationId ,
330338 ) -> DiagnosticBuilder < ' _ , ( ) > {
331339 self . diagnostic ( ) . struct_expect ( msg, id)
332340 }
341+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
333342 pub fn struct_span_err < S : Into < MultiSpan > > (
334343 & self ,
335344 sp : S ,
336345 msg : impl Into < DiagnosticMessage > ,
337346 ) -> DiagnosticBuilder < ' _ , ErrorGuaranteed > {
338347 self . diagnostic ( ) . struct_span_err ( sp, msg)
339348 }
349+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
340350 pub fn struct_span_err_with_code < S : Into < MultiSpan > > (
341351 & self ,
342352 sp : S ,
@@ -346,33 +356,38 @@ impl Session {
346356 self . diagnostic ( ) . struct_span_err_with_code ( sp, msg, code)
347357 }
348358 // FIXME: This method should be removed (every error should have an associated error code).
359+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
349360 pub fn struct_err (
350361 & self ,
351362 msg : impl Into < DiagnosticMessage > ,
352363 ) -> DiagnosticBuilder < ' _ , ErrorGuaranteed > {
353364 self . parse_sess . struct_err ( msg)
354365 }
366+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
355367 pub fn struct_err_with_code (
356368 & self ,
357369 msg : impl Into < DiagnosticMessage > ,
358370 code : DiagnosticId ,
359371 ) -> DiagnosticBuilder < ' _ , ErrorGuaranteed > {
360372 self . diagnostic ( ) . struct_err_with_code ( msg, code)
361373 }
374+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
362375 pub fn struct_warn_with_code (
363376 & self ,
364377 msg : impl Into < DiagnosticMessage > ,
365378 code : DiagnosticId ,
366379 ) -> DiagnosticBuilder < ' _ , ( ) > {
367380 self . diagnostic ( ) . struct_warn_with_code ( msg, code)
368381 }
382+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
369383 pub fn struct_span_fatal < S : Into < MultiSpan > > (
370384 & self ,
371385 sp : S ,
372386 msg : impl Into < DiagnosticMessage > ,
373387 ) -> DiagnosticBuilder < ' _ , !> {
374388 self . diagnostic ( ) . struct_span_fatal ( sp, msg)
375389 }
390+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
376391 pub fn struct_span_fatal_with_code < S : Into < MultiSpan > > (
377392 & self ,
378393 sp : S ,
@@ -381,13 +396,16 @@ impl Session {
381396 ) -> DiagnosticBuilder < ' _ , !> {
382397 self . diagnostic ( ) . struct_span_fatal_with_code ( sp, msg, code)
383398 }
399+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
384400 pub fn struct_fatal ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , !> {
385401 self . diagnostic ( ) . struct_fatal ( msg)
386402 }
387403
404+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
388405 pub fn span_fatal < S : Into < MultiSpan > > ( & self , sp : S , msg : impl Into < DiagnosticMessage > ) -> ! {
389406 self . diagnostic ( ) . span_fatal ( sp, msg)
390407 }
408+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
391409 pub fn span_fatal_with_code < S : Into < MultiSpan > > (
392410 & self ,
393411 sp : S ,
@@ -396,9 +414,11 @@ impl Session {
396414 ) -> ! {
397415 self . diagnostic ( ) . span_fatal_with_code ( sp, msg, code)
398416 }
417+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
399418 pub fn fatal ( & self , msg : impl Into < DiagnosticMessage > ) -> ! {
400419 self . diagnostic ( ) . fatal ( msg) . raise ( )
401420 }
421+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
402422 pub fn span_err_or_warn < S : Into < MultiSpan > > (
403423 & self ,
404424 is_warning : bool ,
@@ -411,13 +431,15 @@ impl Session {
411431 self . span_err ( sp, msg) ;
412432 }
413433 }
434+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
414435 pub fn span_err < S : Into < MultiSpan > > (
415436 & self ,
416437 sp : S ,
417438 msg : impl Into < DiagnosticMessage > ,
418439 ) -> ErrorGuaranteed {
419440 self . diagnostic ( ) . span_err ( sp, msg)
420441 }
442+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
421443 pub fn span_err_with_code < S : Into < MultiSpan > > (
422444 & self ,
423445 sp : S ,
@@ -426,6 +448,7 @@ impl Session {
426448 ) {
427449 self . diagnostic ( ) . span_err_with_code ( sp, msg, code)
428450 }
451+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
429452 pub fn err ( & self , msg : impl Into < DiagnosticMessage > ) -> ErrorGuaranteed {
430453 self . diagnostic ( ) . err ( msg)
431454 }
0 commit comments