@@ -6,7 +6,6 @@ use crate::hir::def_id::CrateNum;
66use rustc_data_structures:: fingerprint:: Fingerprint ;
77
88use crate :: lint;
9- use crate :: lint:: builtin:: BuiltinLintDiagnostics ;
109use crate :: session:: config:: { OutputType , PrintRequest , Sanitizer , SwitchWithOptPath } ;
1110use crate :: session:: search_paths:: { PathKind , SearchPath } ;
1211use crate :: util:: nodemap:: { FxHashMap , FxHashSet } ;
@@ -77,13 +76,6 @@ pub struct Session {
7776 /// if the value stored here has been affected by path remapping.
7877 pub working_dir : ( PathBuf , bool ) ,
7978
80- /// This is intended to be used from a single thread.
81- ///
82- /// FIXME: there was a previous comment about this not being thread safe,
83- /// but it's not clear how or why that's the case. The LintBuffer itself is certainly thread
84- /// safe at least from a "Rust safety" standpoint.
85- pub buffered_lints : Lock < Option < lint:: LintBuffer > > ,
86-
8779 /// Set of `(DiagnosticId, Option<Span>, message)` tuples tracking
8880 /// (sub)diagnostics that have been set once, but should not be set again,
8981 /// in order to avoid redundantly verbose output (Issue #24690, #44953).
@@ -366,37 +358,6 @@ impl Session {
366358 self . diagnostic ( ) . span_note_without_error ( sp, msg)
367359 }
368360
369- pub fn buffer_lint_late < S : Into < MultiSpan > > (
370- & self ,
371- lint : & ' static lint:: Lint ,
372- id : ast:: NodeId ,
373- sp : S ,
374- msg : & str ,
375- ) {
376- match * self . buffered_lints . borrow_mut ( ) {
377- Some ( ref mut buffer) => {
378- buffer. buffer_lint ( lint, id, sp, msg) ;
379- }
380- None => bug ! ( "can't buffer lints after HIR lowering" ) ,
381- }
382- }
383-
384- pub fn buffer_lint_with_diagnostic_late < S : Into < MultiSpan > > (
385- & self ,
386- lint : & ' static lint:: Lint ,
387- id : ast:: NodeId ,
388- sp : S ,
389- msg : & str ,
390- diagnostic : BuiltinLintDiagnostics ,
391- ) {
392- match * self . buffered_lints . borrow_mut ( ) {
393- Some ( ref mut buffer) => buffer. buffer_lint_with_diagnostic (
394- lint, id, sp. into ( ) , msg, diagnostic,
395- ) ,
396- None => bug ! ( "can't buffer lints after HIR lowering" ) ,
397- }
398- }
399-
400361 pub fn reserve_node_ids ( & self , count : usize ) -> ast:: NodeId {
401362 let id = self . next_node_id . get ( ) ;
402363
@@ -1220,7 +1181,6 @@ fn build_session_(
12201181 sysroot,
12211182 local_crate_source_file,
12221183 working_dir,
1223- buffered_lints : Lock :: new ( Some ( Default :: default ( ) ) ) ,
12241184 one_time_diagnostics : Default :: default ( ) ,
12251185 plugin_llvm_passes : OneThread :: new ( RefCell :: new ( Vec :: new ( ) ) ) ,
12261186 plugin_attributes : Lock :: new ( Vec :: new ( ) ) ,
0 commit comments