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
@@ -644,6 +645,7 @@ impl Handler {
644
645
/// Attempting to `.emit()` the builder will only emit if either:
645
646
/// * `can_emit_warnings` is `true`
646
647
/// * `is_force_warn` was set in `DiagnosticId::Lint`
648
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
647
649
pub fn struct_span_warn (
648
650
& self ,
649
651
span : impl Into < MultiSpan > ,
@@ -655,6 +657,7 @@ impl Handler {
655
657
}
656
658
657
659
/// Construct a builder at the `Allow` level at the given `span` and with the `msg`.
660
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
658
661
pub fn struct_span_allow (
659
662
& self ,
660
663
span : impl Into < MultiSpan > ,
@@ -667,6 +670,7 @@ impl Handler {
667
670
668
671
/// Construct a builder at the `Warning` level at the given `span` and with the `msg`.
669
672
/// Also include a code.
673
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
670
674
pub fn struct_span_warn_with_code (
671
675
& self ,
672
676
span : impl Into < MultiSpan > ,
@@ -683,16 +687,19 @@ impl Handler {
683
687
/// Attempting to `.emit()` the builder will only emit if either:
684
688
/// * `can_emit_warnings` is `true`
685
689
/// * `is_force_warn` was set in `DiagnosticId::Lint`
690
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
686
691
pub fn struct_warn ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , ( ) > {
687
692
DiagnosticBuilder :: new ( self , Level :: Warning , msg)
688
693
}
689
694
690
695
/// Construct a builder at the `Allow` level with the `msg`.
696
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
691
697
pub fn struct_allow ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , ( ) > {
692
698
DiagnosticBuilder :: new ( self , Level :: Allow , msg)
693
699
}
694
700
695
701
/// Construct a builder at the `Expect` level with the `msg`.
702
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
696
703
pub fn struct_expect (
697
704
& self ,
698
705
msg : impl Into < DiagnosticMessage > ,
@@ -702,6 +709,7 @@ impl Handler {
702
709
}
703
710
704
711
/// Construct a builder at the `Error` level at the given `span` and with the `msg`.
712
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
705
713
pub fn struct_span_err (
706
714
& self ,
707
715
span : impl Into < MultiSpan > ,
@@ -713,6 +721,7 @@ impl Handler {
713
721
}
714
722
715
723
/// Construct a builder at the `Error` level at the given `span`, with the `msg`, and `code`.
724
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
716
725
pub fn struct_span_err_with_code (
717
726
& self ,
718
727
span : impl Into < MultiSpan > ,
@@ -726,6 +735,7 @@ impl Handler {
726
735
727
736
/// Construct a builder at the `Error` level with the `msg`.
728
737
// FIXME: This method should be removed (every error should have an associated error code).
738
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
729
739
pub fn struct_err (
730
740
& self ,
731
741
msg : impl Into < DiagnosticMessage > ,
@@ -740,6 +750,7 @@ impl Handler {
740
750
}
741
751
742
752
/// Construct a builder at the `Error` level with the `msg` and the `code`.
753
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
743
754
pub fn struct_err_with_code (
744
755
& self ,
745
756
msg : impl Into < DiagnosticMessage > ,
@@ -751,6 +762,7 @@ impl Handler {
751
762
}
752
763
753
764
/// Construct a builder at the `Warn` level with the `msg` and the `code`.
765
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
754
766
pub fn struct_warn_with_code (
755
767
& self ,
756
768
msg : impl Into < DiagnosticMessage > ,
@@ -762,6 +774,7 @@ impl Handler {
762
774
}
763
775
764
776
/// Construct a builder at the `Fatal` level at the given `span` and with the `msg`.
777
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
765
778
pub fn struct_span_fatal (
766
779
& self ,
767
780
span : impl Into < MultiSpan > ,
@@ -773,6 +786,7 @@ impl Handler {
773
786
}
774
787
775
788
/// Construct a builder at the `Fatal` level at the given `span`, with the `msg`, and `code`.
789
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
776
790
pub fn struct_span_fatal_with_code (
777
791
& self ,
778
792
span : impl Into < MultiSpan > ,
@@ -785,28 +799,33 @@ impl Handler {
785
799
}
786
800
787
801
/// Construct a builder at the `Error` level with the `msg`.
802
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
788
803
pub fn struct_fatal ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , !> {
789
804
DiagnosticBuilder :: new_fatal ( self , msg)
790
805
}
791
806
792
807
/// Construct a builder at the `Help` level with the `msg`.
808
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
793
809
pub fn struct_help ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , ( ) > {
794
810
DiagnosticBuilder :: new ( self , Level :: Help , msg)
795
811
}
796
812
797
813
/// Construct a builder at the `Note` level with the `msg`.
814
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
798
815
pub fn struct_note_without_error (
799
816
& self ,
800
817
msg : impl Into < DiagnosticMessage > ,
801
818
) -> DiagnosticBuilder < ' _ , ( ) > {
802
819
DiagnosticBuilder :: new ( self , Level :: Note , msg)
803
820
}
804
821
822
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
805
823
pub fn span_fatal ( & self , span : impl Into < MultiSpan > , msg : impl Into < DiagnosticMessage > ) -> ! {
806
824
self . emit_diag_at_span ( Diagnostic :: new ( Fatal , msg) , span) ;
807
825
FatalError . raise ( )
808
826
}
809
827
828
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
810
829
pub fn span_fatal_with_code (
811
830
& self ,
812
831
span : impl Into < MultiSpan > ,
@@ -817,6 +836,7 @@ impl Handler {
817
836
FatalError . raise ( )
818
837
}
819
838
839
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
820
840
pub fn span_err (
821
841
& self ,
822
842
span : impl Into < MultiSpan > ,
@@ -825,6 +845,7 @@ impl Handler {
825
845
self . emit_diag_at_span ( Diagnostic :: new ( Error { lint : false } , msg) , span) . unwrap ( )
826
846
}
827
847
848
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
828
849
pub fn span_err_with_code (
829
850
& self ,
830
851
span : impl Into < MultiSpan > ,
@@ -837,10 +858,12 @@ impl Handler {
837
858
) ;
838
859
}
839
860
861
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
840
862
pub fn span_warn ( & self , span : impl Into < MultiSpan > , msg : impl Into < DiagnosticMessage > ) {
841
863
self . emit_diag_at_span ( Diagnostic :: new ( Warning , msg) , span) ;
842
864
}
843
865
866
+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
844
867
pub fn span_warn_with_code (
845
868
& self ,
846
869
span : impl Into < MultiSpan > ,
0 commit comments