@@ -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).
@@ -363,37 +355,6 @@ impl Session {
363355 self . diagnostic ( ) . span_note_without_error ( sp, msg)
364356 }
365357
366- pub fn buffer_lint_late < S : Into < MultiSpan > > (
367- & self ,
368- lint : & ' static lint:: Lint ,
369- id : ast:: NodeId ,
370- sp : S ,
371- msg : & str ,
372- ) {
373- match * self . buffered_lints . borrow_mut ( ) {
374- Some ( ref mut buffer) => {
375- buffer. buffer_lint ( lint, id, sp, msg) ;
376- }
377- None => bug ! ( "can't buffer lints after HIR lowering" ) ,
378- }
379- }
380-
381- pub fn buffer_lint_with_diagnostic_late < S : Into < MultiSpan > > (
382- & self ,
383- lint : & ' static lint:: Lint ,
384- id : ast:: NodeId ,
385- sp : S ,
386- msg : & str ,
387- diagnostic : BuiltinLintDiagnostics ,
388- ) {
389- match * self . buffered_lints . borrow_mut ( ) {
390- Some ( ref mut buffer) => buffer. buffer_lint_with_diagnostic (
391- lint, id, sp. into ( ) , msg, diagnostic,
392- ) ,
393- None => bug ! ( "can't buffer lints after HIR lowering" ) ,
394- }
395- }
396-
397358 pub fn reserve_node_ids ( & self , count : usize ) -> ast:: NodeId {
398359 let id = self . next_node_id . get ( ) ;
399360
@@ -1217,7 +1178,6 @@ fn build_session_(
12171178 sysroot,
12181179 local_crate_source_file,
12191180 working_dir,
1220- buffered_lints : Lock :: new ( Some ( Default :: default ( ) ) ) ,
12211181 one_time_diagnostics : Default :: default ( ) ,
12221182 plugin_llvm_passes : OneThread :: new ( RefCell :: new ( Vec :: new ( ) ) ) ,
12231183 plugin_attributes : Lock :: new ( Vec :: new ( ) ) ,
0 commit comments