99#![ feature( let_else) ]
1010#![ feature( never_type) ]
1111#![ feature( adt_const_params) ]
12+ #![ feature( rustc_attrs) ]
1213#![ allow( incomplete_features) ]
1314#![ allow( rustc:: potential_query_instability) ]
1415
@@ -648,6 +649,7 @@ impl Handler {
648649 /// Attempting to `.emit()` the builder will only emit if either:
649650 /// * `can_emit_warnings` is `true`
650651 /// * `is_force_warn` was set in `DiagnosticId::Lint`
652+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
651653 pub fn struct_span_warn (
652654 & self ,
653655 span : impl Into < MultiSpan > ,
@@ -659,6 +661,7 @@ impl Handler {
659661 }
660662
661663 /// Construct a builder at the `Allow` level at the given `span` and with the `msg`.
664+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
662665 pub fn struct_span_allow (
663666 & self ,
664667 span : impl Into < MultiSpan > ,
@@ -671,6 +674,7 @@ impl Handler {
671674
672675 /// Construct a builder at the `Warning` level at the given `span` and with the `msg`.
673676 /// Also include a code.
677+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
674678 pub fn struct_span_warn_with_code (
675679 & self ,
676680 span : impl Into < MultiSpan > ,
@@ -687,16 +691,19 @@ impl Handler {
687691 /// Attempting to `.emit()` the builder will only emit if either:
688692 /// * `can_emit_warnings` is `true`
689693 /// * `is_force_warn` was set in `DiagnosticId::Lint`
694+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
690695 pub fn struct_warn ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , ( ) > {
691696 DiagnosticBuilder :: new ( self , Level :: Warning , msg)
692697 }
693698
694699 /// Construct a builder at the `Allow` level with the `msg`.
700+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
695701 pub fn struct_allow ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , ( ) > {
696702 DiagnosticBuilder :: new ( self , Level :: Allow , msg)
697703 }
698704
699705 /// Construct a builder at the `Expect` level with the `msg`.
706+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
700707 pub fn struct_expect (
701708 & self ,
702709 msg : impl Into < DiagnosticMessage > ,
@@ -706,6 +713,7 @@ impl Handler {
706713 }
707714
708715 /// Construct a builder at the `Error` level at the given `span` and with the `msg`.
716+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
709717 pub fn struct_span_err (
710718 & self ,
711719 span : impl Into < MultiSpan > ,
@@ -717,6 +725,7 @@ impl Handler {
717725 }
718726
719727 /// Construct a builder at the `Error` level at the given `span`, with the `msg`, and `code`.
728+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
720729 pub fn struct_span_err_with_code (
721730 & self ,
722731 span : impl Into < MultiSpan > ,
@@ -730,6 +739,7 @@ impl Handler {
730739
731740 /// Construct a builder at the `Error` level with the `msg`.
732741 // FIXME: This method should be removed (every error should have an associated error code).
742+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
733743 pub fn struct_err (
734744 & self ,
735745 msg : impl Into < DiagnosticMessage > ,
@@ -744,6 +754,7 @@ impl Handler {
744754 }
745755
746756 /// Construct a builder at the `Error` level with the `msg` and the `code`.
757+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
747758 pub fn struct_err_with_code (
748759 & self ,
749760 msg : impl Into < DiagnosticMessage > ,
@@ -755,6 +766,7 @@ impl Handler {
755766 }
756767
757768 /// Construct a builder at the `Warn` level with the `msg` and the `code`.
769+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
758770 pub fn struct_warn_with_code (
759771 & self ,
760772 msg : impl Into < DiagnosticMessage > ,
@@ -766,6 +778,7 @@ impl Handler {
766778 }
767779
768780 /// Construct a builder at the `Fatal` level at the given `span` and with the `msg`.
781+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
769782 pub fn struct_span_fatal (
770783 & self ,
771784 span : impl Into < MultiSpan > ,
@@ -777,6 +790,7 @@ impl Handler {
777790 }
778791
779792 /// Construct a builder at the `Fatal` level at the given `span`, with the `msg`, and `code`.
793+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
780794 pub fn struct_span_fatal_with_code (
781795 & self ,
782796 span : impl Into < MultiSpan > ,
@@ -789,28 +803,33 @@ impl Handler {
789803 }
790804
791805 /// Construct a builder at the `Error` level with the `msg`.
806+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
792807 pub fn struct_fatal ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , !> {
793808 DiagnosticBuilder :: new_fatal ( self , msg)
794809 }
795810
796811 /// Construct a builder at the `Help` level with the `msg`.
812+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
797813 pub fn struct_help ( & self , msg : impl Into < DiagnosticMessage > ) -> DiagnosticBuilder < ' _ , ( ) > {
798814 DiagnosticBuilder :: new ( self , Level :: Help , msg)
799815 }
800816
801817 /// Construct a builder at the `Note` level with the `msg`.
818+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
802819 pub fn struct_note_without_error (
803820 & self ,
804821 msg : impl Into < DiagnosticMessage > ,
805822 ) -> DiagnosticBuilder < ' _ , ( ) > {
806823 DiagnosticBuilder :: new ( self , Level :: Note , msg)
807824 }
808825
826+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
809827 pub fn span_fatal ( & self , span : impl Into < MultiSpan > , msg : impl Into < DiagnosticMessage > ) -> ! {
810828 self . emit_diag_at_span ( Diagnostic :: new ( Fatal , msg) , span) ;
811829 FatalError . raise ( )
812830 }
813831
832+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
814833 pub fn span_fatal_with_code (
815834 & self ,
816835 span : impl Into < MultiSpan > ,
@@ -821,6 +840,7 @@ impl Handler {
821840 FatalError . raise ( )
822841 }
823842
843+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
824844 pub fn span_err (
825845 & self ,
826846 span : impl Into < MultiSpan > ,
@@ -829,6 +849,7 @@ impl Handler {
829849 self . emit_diag_at_span ( Diagnostic :: new ( Error { lint : false } , msg) , span) . unwrap ( )
830850 }
831851
852+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
832853 pub fn span_err_with_code (
833854 & self ,
834855 span : impl Into < MultiSpan > ,
@@ -841,10 +862,12 @@ impl Handler {
841862 ) ;
842863 }
843864
865+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
844866 pub fn span_warn ( & self , span : impl Into < MultiSpan > , msg : impl Into < DiagnosticMessage > ) {
845867 self . emit_diag_at_span ( Diagnostic :: new ( Warning , msg) , span) ;
846868 }
847869
870+ #[ cfg_attr( not( bootstrap) , rustc_lint_diagnostics) ]
848871 pub fn span_warn_with_code (
849872 & self ,
850873 span : impl Into < MultiSpan > ,
0 commit comments