@@ -117,6 +117,7 @@ declare_box_region_type!(
117
117
/// Returns `None` if we're aborting after handling -W help.
118
118
pub fn configure_and_expand (
119
119
sess : Lrc < Session > ,
120
+ lint_store : Lrc < lint:: LintStore > ,
120
121
cstore : Lrc < CStore > ,
121
122
krate : ast:: Crate ,
122
123
crate_name : & str ,
@@ -134,6 +135,7 @@ pub fn configure_and_expand(
134
135
let resolver_arenas = Resolver :: arenas ( ) ;
135
136
let res = configure_and_expand_inner (
136
137
sess,
138
+ & lint_store,
137
139
& * cstore,
138
140
krate,
139
141
& crate_name,
@@ -227,7 +229,7 @@ pub fn register_plugins<'a>(
227
229
cstore : & ' a CStore ,
228
230
mut krate : ast:: Crate ,
229
231
crate_name : & str ,
230
- ) -> Result < ( ast:: Crate , PluginInfo ) > {
232
+ ) -> Result < ( ast:: Crate , PluginInfo , Lrc < lint :: LintStore > ) > {
231
233
krate = time ( sess, "attributes injection" , || {
232
234
syntax_ext:: cmdline_attrs:: inject (
233
235
krate, & sess. parse_sess , & sess. opts . debugging_opts . crate_attr
@@ -278,7 +280,12 @@ pub fn register_plugins<'a>(
278
280
)
279
281
} ) ;
280
282
281
- let mut registry = Registry :: new ( sess, krate. span ) ;
283
+ let mut lint_store = rustc_lint:: new_lint_store (
284
+ sess. opts . debugging_opts . no_interleave_lints ,
285
+ sess. unstable_options ( ) ,
286
+ ) ;
287
+
288
+ let mut registry = Registry :: new ( sess, & mut lint_store, krate. span ) ;
282
289
283
290
time ( sess, "plugin registration" , || {
284
291
for registrar in registrars {
@@ -289,36 +296,20 @@ pub fn register_plugins<'a>(
289
296
290
297
let Registry {
291
298
syntax_exts,
292
- early_lint_passes,
293
- late_lint_passes,
294
- lints,
295
- lint_groups,
296
299
llvm_passes,
297
300
attributes,
298
301
..
299
302
} = registry;
300
303
301
- let mut ls = sess. lint_store . borrow_mut ( ) ;
302
- ls. register_lints ( & lints) ;
303
- for pass in early_lint_passes {
304
- ls. register_early_pass ( pass) ;
305
- }
306
- for pass in late_lint_passes {
307
- ls. register_late_pass ( pass) ;
308
- }
309
-
310
- for ( name, ( to, deprecated_name) ) in lint_groups {
311
- ls. register_group ( true , name, deprecated_name, to) ;
312
- }
313
-
314
304
* sess. plugin_llvm_passes . borrow_mut ( ) = llvm_passes;
315
305
* sess. plugin_attributes . borrow_mut ( ) = attributes;
316
306
317
- Ok ( ( krate, PluginInfo { syntax_exts } ) )
307
+ Ok ( ( krate, PluginInfo { syntax_exts } , Lrc :: new ( lint_store ) ) )
318
308
}
319
309
320
310
fn configure_and_expand_inner < ' a > (
321
311
sess : & ' a Session ,
312
+ lint_store : & ' a lint:: LintStore ,
322
313
cstore : & ' a CStore ,
323
314
mut krate : ast:: Crate ,
324
315
crate_name : & str ,
@@ -329,7 +320,7 @@ fn configure_and_expand_inner<'a>(
329
320
time ( sess, "pre-AST-expansion lint checks" , || {
330
321
lint:: check_ast_crate (
331
322
sess,
332
- & * sess . lint_store . borrow ( ) ,
323
+ lint_store,
333
324
& krate,
334
325
true ,
335
326
rustc_lint:: BuiltinCombinedPreExpansionLintPass :: new ( ) ) ;
@@ -539,6 +530,7 @@ fn configure_and_expand_inner<'a>(
539
530
540
531
pub fn lower_to_hir (
541
532
sess : & Session ,
533
+ lint_store : & lint:: LintStore ,
542
534
cstore : & CStore ,
543
535
resolver : & mut Resolver < ' _ > ,
544
536
dep_graph : & DepGraph ,
@@ -559,7 +551,7 @@ pub fn lower_to_hir(
559
551
time ( sess, "early lint checks" , || {
560
552
lint:: check_ast_crate (
561
553
sess,
562
- & * sess . lint_store . borrow ( ) ,
554
+ lint_store,
563
555
& krate,
564
556
false ,
565
557
rustc_lint:: BuiltinCombinedEarlyLintPass :: new ( ) ,
@@ -826,6 +818,7 @@ impl BoxedGlobalCtxt {
826
818
827
819
pub fn create_global_ctxt (
828
820
compiler : & Compiler ,
821
+ lint_store : Lrc < lint:: LintStore > ,
829
822
mut hir_forest : hir:: map:: Forest ,
830
823
defs : hir:: map:: Definitions ,
831
824
resolutions : Resolutions ,
@@ -863,6 +856,7 @@ pub fn create_global_ctxt(
863
856
864
857
let gcx = TyCtxt :: create_global_ctxt (
865
858
sess,
859
+ lint_store,
866
860
cstore,
867
861
local_providers,
868
862
extern_providers,
0 commit comments