@@ -33,7 +33,7 @@ use rustc_feature::find_gated_cfg;
3333use rustc_fluent_macro:: fluent_messages;
3434use rustc_interface:: util:: { self , collect_crate_types, get_codegen_backend} ;
3535use rustc_interface:: { interface, Queries } ;
36- use rustc_lint:: { unerased_lint_store, LintStore } ;
36+ use rustc_lint:: unerased_lint_store;
3737use rustc_metadata:: locator;
3838use rustc_session:: config:: { nightly_options, CG_OPTIONS , Z_OPTIONS } ;
3939use rustc_session:: config:: { ErrorOutputType , Input , OutFileName , OutputType , TrimmedDefPaths } ;
@@ -356,16 +356,7 @@ fn run_compiler(
356356 let handler = EarlyErrorHandler :: new( sopts. error_format) ;
357357
358358 if sopts. describe_lints {
359- let mut lint_store =
360- rustc_lint:: new_lint_store( compiler. session( ) . enable_internal_lints( ) ) ;
361- let registered_lints =
362- if let Some ( register_lints) = compiler. register_lints( ) {
363- register_lints( compiler. session( ) , & mut lint_store) ;
364- true
365- } else {
366- false
367- } ;
368- describe_lints( compiler. session( ) , & lint_store, registered_lints) ;
359+ describe_lints( compiler. session( ) ) ;
369360 return ;
370361 }
371362 let should_stop = print_crate_info(
@@ -442,9 +433,7 @@ fn run_compiler(
442433 }
443434
444435 if sess. opts. describe_lints {
445- queries
446- . global_ctxt( ) ?
447- . enter( |tcx| describe_lints( sess, unerased_lint_store( tcx) , true ) ) ;
436+ describe_lints( sess) ;
448437 return early_exit( ) ;
449438 }
450439
@@ -991,7 +980,7 @@ the command line flag directly.
991980}
992981
993982/// Write to stdout lint command options, together with a list of all available lints
994- pub fn describe_lints( sess: & Session , lint_store : & LintStore , loaded_lints : bool ) {
983+ pub fn describe_lints( sess: & Session ) {
995984 safe_println!(
996985 "
997986Available lint options:
@@ -1017,6 +1006,7 @@ Available lint options:
10171006 lints
10181007 }
10191008
1009+ let lint_store = unerased_lint_store( sess) ;
10201010 let ( loaded, builtin) : ( Vec <_>, _) =
10211011 lint_store. get_lints( ) . iter( ) . cloned( ) . partition( |& lint| lint. is_loaded) ;
10221012 let loaded = sort_lints( sess, loaded) ;
@@ -1094,7 +1084,7 @@ Available lint options:
10941084
10951085 print_lint_groups( builtin_groups, true ) ;
10961086
1097- match ( loaded_lints , loaded. len( ) , loaded_groups. len( ) ) {
1087+ match ( sess . registered_lints , loaded. len( ) , loaded_groups. len( ) ) {
10981088 ( false , 0 , _) | ( false , _, 0 ) => {
10991089 safe_println!( "Lint tools like Clippy can load additional lints and lint groups." ) ;
11001090 }
0 commit comments