9
9
#![ feature( let_else) ]
10
10
#![ feature( never_type) ]
11
11
#![ feature( adt_const_params) ]
12
+ #![ feature( rustc_attrs) ]
12
13
#![ allow( incomplete_features) ]
13
14
#![ allow( rustc:: potential_query_instability) ]
14
15
@@ -648,6 +649,7 @@ impl Handler {
648
649
/// Attempting to `.emit()` the builder will only emit if either:
649
650
/// * `can_emit_warnings` is `true`
650
651
/// * `is_force_warn` was set in `DiagnosticId::Lint`
652
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
651
653
pub fn struct_span_warn (
652
654
& self ,
653
655
span : impl Into < MultiSpan > ,
@@ -659,6 +661,7 @@ impl Handler {
659
661
}
660
662
661
663
/// Construct a builder at the `Allow` level at the given `span` and with the `msg`.
664
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
662
665
pub fn struct_span_allow (
663
666
& self ,
664
667
span : impl Into < MultiSpan > ,
@@ -671,6 +674,7 @@ impl Handler {
671
674
672
675
/// Construct a builder at the `Warning` level at the given `span` and with the `msg`.
673
676
/// Also include a code.
677
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
674
678
pub fn struct_span_warn_with_code (
675
679
& self ,
676
680
span : impl Into < MultiSpan > ,
@@ -687,16 +691,19 @@ impl Handler {
687
691
/// Attempting to `.emit()` the builder will only emit if either:
688
692
/// * `can_emit_warnings` is `true`
689
693
/// * `is_force_warn` was set in `DiagnosticId::Lint`
694
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
690
695
pub fn struct_warn ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , ( ) > {
691
696
DiagnosticBuilder :: new ( self , Level :: Warning , msg)
692
697
}
693
698
694
699
/// Construct a builder at the `Allow` level with the `msg`.
700
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
695
701
pub fn struct_allow ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , ( ) > {
696
702
DiagnosticBuilder :: new ( self , Level :: Allow , msg)
697
703
}
698
704
699
705
/// Construct a builder at the `Expect` level with the `msg`.
706
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
700
707
pub fn struct_expect (
701
708
& self ,
702
709
msg : impl Into < DiagnosticMessage > ,
@@ -706,6 +713,7 @@ impl Handler {
706
713
}
707
714
708
715
/// Construct a builder at the `Error` level at the given `span` and with the `msg`.
716
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
709
717
pub fn struct_span_err (
710
718
& self ,
711
719
span : impl Into < MultiSpan > ,
@@ -717,6 +725,7 @@ impl Handler {
717
725
}
718
726
719
727
/// Construct a builder at the `Error` level at the given `span`, with the `msg`, and `code`.
728
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
720
729
pub fn struct_span_err_with_code (
721
730
& self ,
722
731
span : impl Into < MultiSpan > ,
@@ -730,6 +739,7 @@ impl Handler {
730
739
731
740
/// Construct a builder at the `Error` level with the `msg`.
732
741
// FIXME: This method should be removed (every error should have an associated error code).
742
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
733
743
pub fn struct_err (
734
744
& self ,
735
745
msg : impl Into < DiagnosticMessage > ,
@@ -744,6 +754,7 @@ impl Handler {
744
754
}
745
755
746
756
/// Construct a builder at the `Error` level with the `msg` and the `code`.
757
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
747
758
pub fn struct_err_with_code (
748
759
& self ,
749
760
msg : impl Into < DiagnosticMessage > ,
@@ -755,6 +766,7 @@ impl Handler {
755
766
}
756
767
757
768
/// Construct a builder at the `Warn` level with the `msg` and the `code`.
769
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
758
770
pub fn struct_warn_with_code (
759
771
& self ,
760
772
msg : impl Into < DiagnosticMessage > ,
@@ -766,6 +778,7 @@ impl Handler {
766
778
}
767
779
768
780
/// Construct a builder at the `Fatal` level at the given `span` and with the `msg`.
781
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
769
782
pub fn struct_span_fatal (
770
783
& self ,
771
784
span : impl Into < MultiSpan > ,
@@ -777,6 +790,7 @@ impl Handler {
777
790
}
778
791
779
792
/// Construct a builder at the `Fatal` level at the given `span`, with the `msg`, and `code`.
793
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
780
794
pub fn struct_span_fatal_with_code (
781
795
& self ,
782
796
span : impl Into < MultiSpan > ,
@@ -789,28 +803,33 @@ impl Handler {
789
803
}
790
804
791
805
/// Construct a builder at the `Error` level with the `msg`.
806
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
792
807
pub fn struct_fatal ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , !> {
793
808
DiagnosticBuilder :: new_fatal ( self , msg)
794
809
}
795
810
796
811
/// Construct a builder at the `Help` level with the `msg`.
812
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
797
813
pub fn struct_help ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , ( ) > {
798
814
DiagnosticBuilder :: new ( self , Level :: Help , msg)
799
815
}
800
816
801
817
/// Construct a builder at the `Note` level with the `msg`.
818
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
802
819
pub fn struct_note_without_error (
803
820
& self ,
804
821
msg : impl Into < DiagnosticMessage > ,
805
822
) -> DiagnosticBuilder < ' _ , ( ) > {
806
823
DiagnosticBuilder :: new ( self , Level :: Note , msg)
807
824
}
808
825
826
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
809
827
pub fn span_fatal ( & self , span : impl Into < MultiSpan > , msg : impl Into < DiagnosticMessage > ) -> ! {
810
828
self . emit_diag_at_span ( Diagnostic :: new ( Fatal , msg) , span) ;
811
829
FatalError . raise ( )
812
830
}
813
831
832
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
814
833
pub fn span_fatal_with_code (
815
834
& self ,
816
835
span : impl Into < MultiSpan > ,
@@ -821,6 +840,7 @@ impl Handler {
821
840
FatalError . raise ( )
822
841
}
823
842
843
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
824
844
pub fn span_err (
825
845
& self ,
826
846
span : impl Into < MultiSpan > ,
@@ -829,6 +849,7 @@ impl Handler {
829
849
self . emit_diag_at_span ( Diagnostic :: new ( Error { lint : false } , msg) , span) . unwrap ( )
830
850
}
831
851
852
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
832
853
pub fn span_err_with_code (
833
854
& self ,
834
855
span : impl Into < MultiSpan > ,
@@ -841,10 +862,12 @@ impl Handler {
841
862
) ;
842
863
}
843
864
865
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
844
866
pub fn span_warn ( & self , span : impl Into < MultiSpan > , msg : impl Into < DiagnosticMessage > ) {
845
867
self . emit_diag_at_span ( Diagnostic :: new ( Warning , msg) , span) ;
846
868
}
847
869
870
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
848
871
pub fn span_warn_with_code (
849
872
& self ,
850
873
span : impl Into < MultiSpan > ,
0 commit comments