@@ -4,8 +4,8 @@ pub use crate::code_stats::{DataTypeKind, FieldInfo, SizeKind, VariantInfo};
4
4
use crate :: config:: { self , CrateType , InstrumentCoverage , OptLevel , OutputType , SwitchWithOptPath } ;
5
5
use crate :: errors:: {
6
6
CannotEnableCrtStaticLinux , CannotMixAndMatchSanitizers , LinkerPluginToWindowsNotSupported ,
7
- NotCircumventFeature , ProfileSampleUseFileDoesNotExist , ProfileUseFileDoesNotExist ,
8
- SanitizerCfiEnabled , SanitizerNotSupported , SanitizersNotSupported ,
7
+ NotCircumventFeature , OptimisationFuelExhausted , ProfileSampleUseFileDoesNotExist ,
8
+ ProfileUseFileDoesNotExist , SanitizerCfiEnabled , SanitizerNotSupported , SanitizersNotSupported ,
9
9
SplitDebugInfoUnstablePlatform , StackProtectorNotSupportedForTarget ,
10
10
TargetRequiresUnwindTables , UnstableVirtualFunctionElimination , UnsupportedDwarfVersion ,
11
11
} ;
@@ -510,6 +510,8 @@ impl Session {
510
510
self . diagnostic ( ) . span_err_with_code ( sp, msg, code)
511
511
}
512
512
#[ rustc_lint_diagnostics]
513
+ #[ allow( rustc:: untranslatable_diagnostic) ]
514
+ #[ allow( rustc:: diagnostic_outside_of_impl) ]
513
515
pub fn err ( & self , msg : impl Into < DiagnosticMessage > ) -> ErrorGuaranteed {
514
516
self . diagnostic ( ) . err ( msg)
515
517
}
@@ -595,11 +597,19 @@ impl Session {
595
597
Err ( ErrorGuaranteed :: unchecked_claim_error_was_emitted ( ) )
596
598
}
597
599
}
600
+
601
+ // #[allow(rustc::untranslatable_diagnostic)]
602
+ // #[allow(rustc::diagnostic_outside_of_impl)]
603
+ #[ rustc_lint_diagnostics]
598
604
#[ allow( rustc:: untranslatable_diagnostic) ]
599
605
#[ allow( rustc:: diagnostic_outside_of_impl) ]
600
606
pub fn span_warn < S : Into < MultiSpan > > ( & self , sp : S , msg : impl Into < DiagnosticMessage > ) {
601
607
self . diagnostic ( ) . span_warn ( sp, msg)
602
608
}
609
+
610
+ // #[allow(rustc::untranslatable_diagnostic)]
611
+ // #[allow(rustc::diagnostic_outside_of_impl)]
612
+ #[ rustc_lint_diagnostics]
603
613
#[ allow( rustc:: untranslatable_diagnostic) ]
604
614
#[ allow( rustc:: diagnostic_outside_of_impl) ]
605
615
pub fn span_warn_with_code < S : Into < MultiSpan > > (
@@ -610,6 +620,10 @@ impl Session {
610
620
) {
611
621
self . diagnostic ( ) . span_warn_with_code ( sp, msg, code)
612
622
}
623
+
624
+ #[ rustc_lint_diagnostics]
625
+ #[ allow( rustc:: untranslatable_diagnostic) ]
626
+ #[ allow( rustc:: diagnostic_outside_of_impl) ]
613
627
pub fn warn ( & self , msg : impl Into < DiagnosticMessage > ) {
614
628
self . diagnostic ( ) . warn ( msg)
615
629
}
@@ -640,16 +654,26 @@ impl Session {
640
654
self . diagnostic ( ) . delay_good_path_bug ( msg)
641
655
}
642
656
657
+ #[ rustc_lint_diagnostics]
658
+ #[ allow( rustc:: untranslatable_diagnostic) ]
659
+ #[ allow( rustc:: diagnostic_outside_of_impl) ]
643
660
pub fn note_without_error ( & self , msg : impl Into < DiagnosticMessage > ) {
644
661
self . diagnostic ( ) . note_without_error ( msg)
645
662
}
663
+ #[ rustc_lint_diagnostics]
664
+ #[ allow( rustc:: untranslatable_diagnostic) ]
665
+ #[ allow( rustc:: diagnostic_outside_of_impl) ]
646
666
pub fn span_note_without_error < S : Into < MultiSpan > > (
647
667
& self ,
648
668
sp : S ,
649
669
msg : impl Into < DiagnosticMessage > ,
650
670
) {
651
671
self . diagnostic ( ) . span_note_without_error ( sp, msg)
652
672
}
673
+
674
+ // #[allow(rustc::untranslatable_diagnostic)]
675
+ // #[allow(rustc::diagnostic_outside_of_impl)]
676
+ #[ rustc_lint_diagnostics]
653
677
#[ allow( rustc:: untranslatable_diagnostic) ]
654
678
#[ allow( rustc:: diagnostic_outside_of_impl) ]
655
679
pub fn struct_note_without_error (
@@ -879,7 +903,7 @@ impl Session {
879
903
// We only call `msg` in case we can actually emit warnings.
880
904
// Otherwise, this could cause a `delay_good_path_bug` to
881
905
// trigger (issue #79546).
882
- self . warn ( & format ! ( "optimization-fuel-exhausted: {}" , msg( ) ) ) ;
906
+ self . emit_warning ( OptimisationFuelExhausted { msg : msg ( ) } ) ;
883
907
}
884
908
fuel. out_of_fuel = true ;
885
909
} else if fuel. remaining > 0 {
0 commit comments