@@ -330,6 +330,7 @@ impl Session {
330330 self . diagnostic ( ) . struct_warn_with_expectation ( msg, id)
331331 }
332332 #[ rustc_lint_diagnostics]
333+ #[ track_caller]
333334 pub fn struct_span_allow < S : Into < MultiSpan > > (
334335 & self ,
335336 sp : S ,
@@ -338,10 +339,12 @@ impl Session {
338339 self . diagnostic ( ) . struct_span_allow ( sp, msg)
339340 }
340341 #[ rustc_lint_diagnostics]
342+ #[ track_caller]
341343 pub fn struct_allow ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , ( ) > {
342344 self . diagnostic ( ) . struct_allow ( msg)
343345 }
344346 #[ rustc_lint_diagnostics]
347+ #[ track_caller]
345348 pub fn struct_expect (
346349 & self ,
347350 msg : impl Into < DiagnosticMessage > ,
@@ -396,6 +399,7 @@ impl Session {
396399 self . diagnostic ( ) . struct_warn_with_code ( msg, code)
397400 }
398401 #[ rustc_lint_diagnostics]
402+ #[ track_caller]
399403 pub fn struct_span_fatal < S : Into < MultiSpan > > (
400404 & self ,
401405 sp : S ,
@@ -418,6 +422,7 @@ impl Session {
418422 }
419423
420424 #[ rustc_lint_diagnostics]
425+ #[ track_caller]
421426 pub fn span_fatal < S : Into < MultiSpan > > ( & self , sp : S , msg : impl Into < DiagnosticMessage > ) -> ! {
422427 self . diagnostic ( ) . span_fatal ( sp, msg)
423428 }
@@ -490,33 +495,40 @@ impl Session {
490495 add_feature_diagnostics ( & mut err, & self . parse_sess , feature) ;
491496 err
492497 }
498+ #[ track_caller]
493499 pub fn emit_err < ' a > ( & ' a self , err : impl IntoDiagnostic < ' a > ) -> ErrorGuaranteed {
494500 self . parse_sess . emit_err ( err)
495501 }
502+ #[ track_caller]
496503 pub fn create_warning < ' a > (
497504 & ' a self ,
498505 err : impl IntoDiagnostic < ' a , ( ) > ,
499506 ) -> DiagnosticBuilder < ' a , ( ) > {
500507 self . parse_sess . create_warning ( err)
501508 }
509+ #[ track_caller]
502510 pub fn emit_warning < ' a > ( & ' a self , warning : impl IntoDiagnostic < ' a , ( ) > ) {
503511 self . parse_sess . emit_warning ( warning)
504512 }
513+ #[ track_caller]
505514 pub fn create_note < ' a > (
506515 & ' a self ,
507516 note : impl IntoDiagnostic < ' a , Noted > ,
508517 ) -> DiagnosticBuilder < ' a , Noted > {
509518 self . parse_sess . create_note ( note)
510519 }
520+ #[ track_caller]
511521 pub fn emit_note < ' a > ( & ' a self , note : impl IntoDiagnostic < ' a , Noted > ) -> Noted {
512522 self . parse_sess . emit_note ( note)
513523 }
524+ #[ track_caller]
514525 pub fn create_fatal < ' a > (
515526 & ' a self ,
516527 fatal : impl IntoDiagnostic < ' a , !> ,
517528 ) -> DiagnosticBuilder < ' a , !> {
518529 self . parse_sess . create_fatal ( fatal)
519530 }
531+ #[ track_caller]
520532 pub fn emit_fatal < ' a > ( & ' a self , fatal : impl IntoDiagnostic < ' a , !> ) -> ! {
521533 self . parse_sess . emit_fatal ( fatal)
522534 }
@@ -556,6 +568,7 @@ impl Session {
556568 }
557569 #[ allow( rustc:: untranslatable_diagnostic) ]
558570 #[ allow( rustc:: diagnostic_outside_of_impl) ]
571+ #[ track_caller]
559572 pub fn span_warn < S : Into < MultiSpan > > ( & self , sp : S , msg : impl Into < DiagnosticMessage > ) {
560573 self . diagnostic ( ) . span_warn ( sp, msg)
561574 }
@@ -602,6 +615,8 @@ impl Session {
602615 pub fn note_without_error ( & self , msg : impl Into < DiagnosticMessage > ) {
603616 self . diagnostic ( ) . note_without_error ( msg)
604617 }
618+
619+ #[ track_caller]
605620 pub fn span_note_without_error < S : Into < MultiSpan > > (
606621 & self ,
607622 sp : S ,
0 commit comments