@@ -7,6 +7,7 @@ use std::sync::atomic::AtomicBool;
77use std:: { env, fmt, io} ;
88
99use rand:: { RngCore , rng} ;
10+ use rustc_ast:: NodeId ;
1011use rustc_data_structures:: base_n:: { CASE_INSENSITIVE , ToBaseN } ;
1112use rustc_data_structures:: flock;
1213use rustc_data_structures:: fx:: { FxHashMap , FxIndexSet } ;
@@ -22,7 +23,7 @@ use rustc_errors::timings::TimingSectionHandler;
2223use rustc_errors:: translation:: Translator ;
2324use rustc_errors:: {
2425 Diag , DiagCtxt , DiagCtxtHandle , DiagMessage , Diagnostic , ErrorGuaranteed , FatalAbort ,
25- TerminalUrl , fallback_fluent_bundle,
26+ LintEmitter , TerminalUrl , fallback_fluent_bundle,
2627} ;
2728use rustc_macros:: HashStable_Generic ;
2829pub use rustc_span:: def_id:: StableCrateId ;
@@ -223,6 +224,20 @@ pub struct Session {
223224 pub invocation_temp : Option < String > ,
224225}
225226
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+
226241#[ derive( Clone , Copy ) ]
227242pub enum CodegenUnits {
228243 /// Specified by the user. In this case we try fairly hard to produce the
0 commit comments