@@ -632,27 +632,15 @@ impl Handler {
632632
633633 /// Construct a builder at the `Warning` level at the given `span` and with the `msg`.
634634 ///
635- /// The builder will be canceled if warnings cannot be emitted.
635+ /// Attempting to `.emit()` the builder will only emit if either:
636+ /// * `can_emit_warnings` is `true`
637+ /// * `is_force_warn` was set in `DiagnosticId::Lint`
636638 pub fn struct_span_warn ( & self , span : impl Into < MultiSpan > , msg : & str ) -> DiagnosticBuilder < ' _ > {
637639 let mut result = self . struct_warn ( msg) ;
638640 result. set_span ( span) ;
639641 result
640642 }
641643
642- /// Construct a builder at the `Warning` level at the given `span` and with the `msg`.
643- ///
644- /// This will "force" the warning meaning it will not be canceled even
645- /// if warnings cannot be emitted.
646- pub fn struct_span_force_warn (
647- & self ,
648- span : impl Into < MultiSpan > ,
649- msg : & str ,
650- ) -> DiagnosticBuilder < ' _ > {
651- let mut result = self . struct_force_warn ( msg) ;
652- result. set_span ( span) ;
653- result
654- }
655-
656644 /// Construct a builder at the `Allow` level at the given `span` and with the `msg`.
657645 pub fn struct_span_allow (
658646 & self ,
@@ -679,20 +667,10 @@ impl Handler {
679667
680668 /// Construct a builder at the `Warning` level with the `msg`.
681669 ///
682- /// The builder will be canceled if warnings cannot be emitted.
670+ /// Attempting to `.emit()` the builder will only emit if either:
671+ /// * `can_emit_warnings` is `true`
672+ /// * `is_force_warn` was set in `DiagnosticId::Lint`
683673 pub fn struct_warn ( & self , msg : & str ) -> DiagnosticBuilder < ' _ > {
684- let mut result = DiagnosticBuilder :: new ( self , Level :: Warning , msg) ;
685- if !self . flags . can_emit_warnings {
686- result. cancel ( ) ;
687- }
688- result
689- }
690-
691- /// Construct a builder at the `Warning` level with the `msg`.
692- ///
693- /// This will "force" a warning meaning it will not be canceled even
694- /// if warnings cannot be emitted.
695- pub fn struct_force_warn ( & self , msg : & str ) -> DiagnosticBuilder < ' _ > {
696674 DiagnosticBuilder :: new ( self , Level :: Warning , msg)
697675 }
698676
0 commit comments