2121pub use self :: Level :: * ;
2222pub use self :: LintSource :: * ;
2323
24- use crate :: lint:: builtin:: BuiltinLintDiagnostics ;
2524use crate :: ty:: TyCtxt ;
2625use rustc_data_structures:: sync;
2726use rustc_errors:: { DiagnosticBuilder , DiagnosticId } ;
2827use rustc_hir as hir;
29- use rustc_session:: node_id:: NodeMap ;
3028use rustc_session:: { DiagnosticMessageId , Session } ;
3129use rustc_span:: hygiene:: MacroKind ;
3230use rustc_span:: source_map:: { DesugaringKind , ExpnKind , MultiSpan } ;
@@ -35,10 +33,10 @@ use rustc_span::Span;
3533use syntax:: ast;
3634
3735pub use crate :: lint:: context:: {
38- BufferedEarlyLint , CheckLintNameResult , EarlyContext , LateContext , LintContext , LintStore ,
36+ CheckLintNameResult , EarlyContext , LateContext , LintContext , LintStore ,
3937} ;
4038
41- pub use rustc_session:: lint:: { FutureIncompatibleInfo , Level , Lint , LintId } ;
39+ pub use rustc_session:: lint:: { BufferedEarlyLint , FutureIncompatibleInfo , Level , Lint , LintId } ;
4240
4341/// Declares a static `LintArray` and return it as an expression.
4442#[ macro_export]
@@ -373,59 +371,6 @@ mod levels;
373371
374372pub use self :: levels:: { LintLevelMap , LintLevelSets , LintLevelsBuilder } ;
375373
376- #[ derive( Default ) ]
377- pub struct LintBuffer {
378- pub map : NodeMap < Vec < BufferedEarlyLint > > ,
379- }
380-
381- impl LintBuffer {
382- pub fn add_lint (
383- & mut self ,
384- lint : & ' static Lint ,
385- id : ast:: NodeId ,
386- sp : MultiSpan ,
387- msg : & str ,
388- diagnostic : BuiltinLintDiagnostics ,
389- ) {
390- let early_lint = BufferedEarlyLint {
391- lint_id : LintId :: of ( lint) ,
392- ast_id : id,
393- span : sp,
394- msg : msg. to_string ( ) ,
395- diagnostic,
396- } ;
397- let arr = self . map . entry ( id) . or_default ( ) ;
398- if !arr. contains ( & early_lint) {
399- arr. push ( early_lint) ;
400- }
401- }
402-
403- pub fn take ( & mut self , id : ast:: NodeId ) -> Vec < BufferedEarlyLint > {
404- self . map . remove ( & id) . unwrap_or_default ( )
405- }
406-
407- pub fn buffer_lint < S : Into < MultiSpan > > (
408- & mut self ,
409- lint : & ' static Lint ,
410- id : ast:: NodeId ,
411- sp : S ,
412- msg : & str ,
413- ) {
414- self . add_lint ( lint, id, sp. into ( ) , msg, BuiltinLintDiagnostics :: Normal )
415- }
416-
417- pub fn buffer_lint_with_diagnostic < S : Into < MultiSpan > > (
418- & mut self ,
419- lint : & ' static Lint ,
420- id : ast:: NodeId ,
421- sp : S ,
422- msg : & str ,
423- diagnostic : BuiltinLintDiagnostics ,
424- ) {
425- self . add_lint ( lint, id, sp. into ( ) , msg, diagnostic)
426- }
427- }
428-
429374pub fn struct_lint_level < ' a > (
430375 sess : & ' a Session ,
431376 lint : & ' static Lint ,
0 commit comments