@@ -280,13 +280,15 @@ impl Session {
280
280
self . crate_types . set ( crate_types) . expect ( "`crate_types` was initialized twice" )
281
281
}
282
282
283
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
283
284
pub fn struct_span_warn < S : Into < MultiSpan > > (
284
285
& self ,
285
286
sp : S ,
286
287
msg : impl Into < DiagnosticMessage > ,
287
288
) -> DiagnosticBuilder < ' _ , ( ) > {
288
289
self . diagnostic ( ) . struct_span_warn ( sp, msg)
289
290
}
291
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
290
292
pub fn struct_span_warn_with_expectation < S : Into < MultiSpan > > (
291
293
& self ,
292
294
sp : S ,
@@ -295,6 +297,7 @@ impl Session {
295
297
) -> DiagnosticBuilder < ' _ , ( ) > {
296
298
self . diagnostic ( ) . struct_span_warn_with_expectation ( sp, msg, id)
297
299
}
300
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
298
301
pub fn struct_span_warn_with_code < S : Into < MultiSpan > > (
299
302
& self ,
300
303
sp : S ,
@@ -303,40 +306,47 @@ impl Session {
303
306
) -> DiagnosticBuilder < ' _ , ( ) > {
304
307
self . diagnostic ( ) . struct_span_warn_with_code ( sp, msg, code)
305
308
}
309
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
306
310
pub fn struct_warn ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , ( ) > {
307
311
self . diagnostic ( ) . struct_warn ( msg)
308
312
}
313
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
309
314
pub fn struct_warn_with_expectation (
310
315
& self ,
311
316
msg : impl Into < DiagnosticMessage > ,
312
317
id : lint:: LintExpectationId ,
313
318
) -> DiagnosticBuilder < ' _ , ( ) > {
314
319
self . diagnostic ( ) . struct_warn_with_expectation ( msg, id)
315
320
}
321
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
316
322
pub fn struct_span_allow < S : Into < MultiSpan > > (
317
323
& self ,
318
324
sp : S ,
319
325
msg : impl Into < DiagnosticMessage > ,
320
326
) -> DiagnosticBuilder < ' _ , ( ) > {
321
327
self . diagnostic ( ) . struct_span_allow ( sp, msg)
322
328
}
329
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
323
330
pub fn struct_allow ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , ( ) > {
324
331
self . diagnostic ( ) . struct_allow ( msg)
325
332
}
333
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
326
334
pub fn struct_expect (
327
335
& self ,
328
336
msg : impl Into < DiagnosticMessage > ,
329
337
id : lint:: LintExpectationId ,
330
338
) -> DiagnosticBuilder < ' _ , ( ) > {
331
339
self . diagnostic ( ) . struct_expect ( msg, id)
332
340
}
341
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
333
342
pub fn struct_span_err < S : Into < MultiSpan > > (
334
343
& self ,
335
344
sp : S ,
336
345
msg : impl Into < DiagnosticMessage > ,
337
346
) -> DiagnosticBuilder < ' _ , ErrorGuaranteed > {
338
347
self . diagnostic ( ) . struct_span_err ( sp, msg)
339
348
}
349
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
340
350
pub fn struct_span_err_with_code < S : Into < MultiSpan > > (
341
351
& self ,
342
352
sp : S ,
@@ -346,33 +356,38 @@ impl Session {
346
356
self . diagnostic ( ) . struct_span_err_with_code ( sp, msg, code)
347
357
}
348
358
// FIXME: This method should be removed (every error should have an associated error code).
359
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
349
360
pub fn struct_err (
350
361
& self ,
351
362
msg : impl Into < DiagnosticMessage > ,
352
363
) -> DiagnosticBuilder < ' _ , ErrorGuaranteed > {
353
364
self . parse_sess . struct_err ( msg)
354
365
}
366
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
355
367
pub fn struct_err_with_code (
356
368
& self ,
357
369
msg : impl Into < DiagnosticMessage > ,
358
370
code : DiagnosticId ,
359
371
) -> DiagnosticBuilder < ' _ , ErrorGuaranteed > {
360
372
self . diagnostic ( ) . struct_err_with_code ( msg, code)
361
373
}
374
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
362
375
pub fn struct_warn_with_code (
363
376
& self ,
364
377
msg : impl Into < DiagnosticMessage > ,
365
378
code : DiagnosticId ,
366
379
) -> DiagnosticBuilder < ' _ , ( ) > {
367
380
self . diagnostic ( ) . struct_warn_with_code ( msg, code)
368
381
}
382
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
369
383
pub fn struct_span_fatal < S : Into < MultiSpan > > (
370
384
& self ,
371
385
sp : S ,
372
386
msg : impl Into < DiagnosticMessage > ,
373
387
) -> DiagnosticBuilder < ' _ , !> {
374
388
self . diagnostic ( ) . struct_span_fatal ( sp, msg)
375
389
}
390
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
376
391
pub fn struct_span_fatal_with_code < S : Into < MultiSpan > > (
377
392
& self ,
378
393
sp : S ,
@@ -381,13 +396,16 @@ impl Session {
381
396
) -> DiagnosticBuilder < ' _ , !> {
382
397
self . diagnostic ( ) . struct_span_fatal_with_code ( sp, msg, code)
383
398
}
399
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
384
400
pub fn struct_fatal ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , !> {
385
401
self . diagnostic ( ) . struct_fatal ( msg)
386
402
}
387
403
404
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
388
405
pub fn span_fatal < S : Into < MultiSpan > > ( & self , sp : S , msg : impl Into < DiagnosticMessage > ) -> ! {
389
406
self . diagnostic ( ) . span_fatal ( sp, msg)
390
407
}
408
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
391
409
pub fn span_fatal_with_code < S : Into < MultiSpan > > (
392
410
& self ,
393
411
sp : S ,
@@ -396,9 +414,11 @@ impl Session {
396
414
) -> ! {
397
415
self . diagnostic ( ) . span_fatal_with_code ( sp, msg, code)
398
416
}
417
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
399
418
pub fn fatal ( & self , msg : impl Into < DiagnosticMessage > ) -> ! {
400
419
self . diagnostic ( ) . fatal ( msg) . raise ( )
401
420
}
421
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
402
422
pub fn span_err_or_warn < S : Into < MultiSpan > > (
403
423
& self ,
404
424
is_warning : bool ,
@@ -411,13 +431,15 @@ impl Session {
411
431
self . span_err ( sp, msg) ;
412
432
}
413
433
}
434
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
414
435
pub fn span_err < S : Into < MultiSpan > > (
415
436
& self ,
416
437
sp : S ,
417
438
msg : impl Into < DiagnosticMessage > ,
418
439
) -> ErrorGuaranteed {
419
440
self . diagnostic ( ) . span_err ( sp, msg)
420
441
}
442
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
421
443
pub fn span_err_with_code < S : Into < MultiSpan > > (
422
444
& self ,
423
445
sp : S ,
@@ -426,6 +448,7 @@ impl Session {
426
448
) {
427
449
self . diagnostic ( ) . span_err_with_code ( sp, msg, code)
428
450
}
451
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
429
452
pub fn err ( & self , msg : impl Into < DiagnosticMessage > ) -> ErrorGuaranteed {
430
453
self . diagnostic ( ) . err ( msg)
431
454
}
0 commit comments