File tree 2 files changed +10
-17
lines changed
rustc_macros/src/diagnostics
2 files changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -764,19 +764,7 @@ pub struct LintBuffer {
764
764
765
765
impl LintBuffer {
766
766
pub fn add_early_lint ( & mut self , early_lint : BufferedEarlyLint ) {
767
- let arr = self . map . entry ( early_lint. node_id ) . or_default ( ) ;
768
- arr. push ( early_lint) ;
769
- }
770
-
771
- pub fn add_lint (
772
- & mut self ,
773
- lint : & ' static Lint ,
774
- node_id : NodeId ,
775
- span : MultiSpan ,
776
- diagnostic : BuiltinLintDiag ,
777
- ) {
778
- let lint_id = LintId :: of ( lint) ;
779
- self . add_early_lint ( BufferedEarlyLint { lint_id, node_id, span, diagnostic } ) ;
767
+ self . map . entry ( early_lint. node_id ) . or_default ( ) . push ( early_lint) ;
780
768
}
781
769
782
770
pub fn take ( & mut self , id : NodeId ) -> Vec < BufferedEarlyLint > {
@@ -787,11 +775,16 @@ impl LintBuffer {
787
775
pub fn buffer_lint (
788
776
& mut self ,
789
777
lint : & ' static Lint ,
790
- id : NodeId ,
791
- sp : impl Into < MultiSpan > ,
778
+ node_id : NodeId ,
779
+ span : impl Into < MultiSpan > ,
792
780
diagnostic : BuiltinLintDiag ,
793
781
) {
794
- self . add_lint ( lint, id, sp. into ( ) , diagnostic)
782
+ self . add_early_lint ( BufferedEarlyLint {
783
+ lint_id : LintId :: of ( lint) ,
784
+ node_id,
785
+ span : span. into ( ) ,
786
+ diagnostic,
787
+ } ) ;
795
788
}
796
789
}
797
790
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ pub fn diagnostic_derive(mut s: Structure<'_>) -> TokenStream {
91
91
/// Then, later, to emit the error:
92
92
///
93
93
/// ```ignore (rust)
94
- /// cx.span_lint (INVALID_ATOMIC_ORDERING, fail_order_arg_span, AtomicOrderingInvalidLint {
94
+ /// cx.emit_span_lint (INVALID_ATOMIC_ORDERING, fail_order_arg_span, AtomicOrderingInvalidLint {
95
95
/// method,
96
96
/// success_ordering,
97
97
/// fail_ordering,
You can’t perform that action at this time.
0 commit comments