@@ -7,6 +7,7 @@ use std::sync::atomic::AtomicBool;
7
7
use std:: { env, fmt, io} ;
8
8
9
9
use rand:: { RngCore , rng} ;
10
+ use rustc_ast:: NodeId ;
10
11
use rustc_data_structures:: base_n:: { CASE_INSENSITIVE , ToBaseN } ;
11
12
use rustc_data_structures:: flock;
12
13
use rustc_data_structures:: fx:: { FxHashMap , FxIndexSet } ;
@@ -22,7 +23,7 @@ use rustc_errors::timings::TimingSectionHandler;
22
23
use rustc_errors:: translation:: Translator ;
23
24
use rustc_errors:: {
24
25
Diag , DiagCtxt , DiagCtxtHandle , DiagMessage , Diagnostic , ErrorGuaranteed , FatalAbort ,
25
- TerminalUrl , fallback_fluent_bundle,
26
+ LintEmitter , TerminalUrl , fallback_fluent_bundle,
26
27
} ;
27
28
use rustc_macros:: HashStable_Generic ;
28
29
pub use rustc_span:: def_id:: StableCrateId ;
@@ -223,6 +224,20 @@ pub struct Session {
223
224
pub invocation_temp : Option < String > ,
224
225
}
225
226
227
+ impl LintEmitter for & ' _ Session {
228
+ type Id = NodeId ;
229
+
230
+ fn emit_node_span_lint (
231
+ self ,
232
+ lint : & ' static rustc_lint_defs:: Lint ,
233
+ node_id : Self :: Id ,
234
+ span : impl Into < rustc_errors:: MultiSpan > ,
235
+ decorator : impl for < ' a > rustc_errors:: LintDiagnostic < ' a , ( ) > + DynSend + ' static ,
236
+ ) {
237
+ self . psess . buffer_lint ( lint, span, node_id, decorator) ;
238
+ }
239
+ }
240
+
226
241
#[ derive( Clone , Copy ) ]
227
242
pub enum CodegenUnits {
228
243
/// Specified by the user. In this case we try fairly hard to produce the
0 commit comments