1717#[ macro_use]
1818extern crate tracing;
1919
20- pub extern crate rustc_plugin_impl as plugin;
21-
2220use rustc_ast as ast;
2321use rustc_codegen_ssa:: { traits:: CodegenBackend , CodegenErrors , CodegenResults } ;
2422use rustc_data_structures:: profiling:: {
@@ -129,7 +127,6 @@ pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[
129127 rustc_monomorphize:: DEFAULT_LOCALE_RESOURCE ,
130128 rustc_parse:: DEFAULT_LOCALE_RESOURCE ,
131129 rustc_passes:: DEFAULT_LOCALE_RESOURCE ,
132- rustc_plugin_impl:: DEFAULT_LOCALE_RESOURCE ,
133130 rustc_privacy:: DEFAULT_LOCALE_RESOURCE ,
134131 rustc_query_system:: DEFAULT_LOCALE_RESOURCE ,
135132 rustc_resolve:: DEFAULT_LOCALE_RESOURCE ,
@@ -970,16 +967,14 @@ the command line flag directly.
970967}
971968
972969/// Write to stdout lint command options, together with a list of all available lints
973- pub fn describe_lints( sess: & Session , lint_store: & LintStore , loaded_plugins : bool ) {
970+ pub fn describe_lints( sess: & Session , lint_store: & LintStore , loaded_lints : bool ) {
974971 safe_println!(
975972 "
976973Available lint options:
977974 -W <foo> Warn about <foo>
978- -A <foo> \
979- Allow <foo>
975+ -A <foo> Allow <foo>
980976 -D <foo> Deny <foo>
981- -F <foo> Forbid <foo> \
982- (deny <foo> and all attempts to override)
977+ -F <foo> Forbid <foo> (deny <foo> and all attempts to override)
983978
984979"
985980 ) ;
@@ -998,18 +993,18 @@ Available lint options:
998993 lints
999994 }
1000995
1001- let ( plugin , builtin) : ( Vec <_>, _) =
1002- lint_store. get_lints( ) . iter( ) . cloned( ) . partition( |& lint| lint. is_plugin ) ;
1003- let plugin = sort_lints( sess, plugin ) ;
996+ let ( loaded , builtin) : ( Vec <_>, _) =
997+ lint_store. get_lints( ) . iter( ) . cloned( ) . partition( |& lint| lint. is_loaded ) ;
998+ let loaded = sort_lints( sess, loaded ) ;
1004999 let builtin = sort_lints( sess, builtin) ;
10051000
1006- let ( plugin_groups , builtin_groups) : ( Vec <_>, _) =
1001+ let ( loaded_groups , builtin_groups) : ( Vec <_>, _) =
10071002 lint_store. get_lint_groups( ) . partition( |& ( .., p) | p) ;
1008- let plugin_groups = sort_lint_groups( plugin_groups ) ;
1003+ let loaded_groups = sort_lint_groups( loaded_groups ) ;
10091004 let builtin_groups = sort_lint_groups( builtin_groups) ;
10101005
10111006 let max_name_len =
1012- plugin . iter( ) . chain( & builtin) . map( |& s| s. name. chars( ) . count( ) ) . max( ) . unwrap_or( 0 ) ;
1007+ loaded . iter( ) . chain( & builtin) . map( |& s| s. name. chars( ) . count( ) ) . max( ) . unwrap_or( 0 ) ;
10131008 let padded = |x: & str | {
10141009 let mut s = " " . repeat( max_name_len - x. chars( ) . count( ) ) ;
10151010 s. push_str( x) ;
@@ -1037,7 +1032,7 @@ Available lint options:
10371032
10381033 let max_name_len = max(
10391034 "warnings" . len( ) ,
1040- plugin_groups
1035+ loaded_groups
10411036 . iter( )
10421037 . chain( & builtin_groups)
10431038 . map( |& ( s, _) | s. chars( ) . count( ) )
@@ -1075,20 +1070,22 @@ Available lint options:
10751070
10761071 print_lint_groups( builtin_groups, true ) ;
10771072
1078- match ( loaded_plugins , plugin . len( ) , plugin_groups . len( ) ) {
1073+ match ( loaded_lints , loaded . len( ) , loaded_groups . len( ) ) {
10791074 ( false , 0 , _) | ( false , _, 0 ) => {
1080- safe_println!( "Lint tools like Clippy can provide additional lints and lint groups." ) ;
1075+ safe_println!( "Lint tools like Clippy can load additional lints and lint groups." ) ;
1076+ }
1077+ ( false , ..) => panic!( "didn't load additional lints but got them anyway!" ) ,
1078+ ( true , 0 , 0 ) => {
1079+ safe_println!( "This crate does not load any additional lints or lint groups." )
10811080 }
1082- ( false , ..) => panic!( "didn't load lint plugins but got them anyway!" ) ,
1083- ( true , 0 , 0 ) => safe_println!( "This crate does not load any lint plugins or lint groups." ) ,
10841081 ( true , l, g) => {
10851082 if l > 0 {
1086- safe_println!( "Lint checks provided by plugins loaded by this crate:\n " ) ;
1087- print_lints( plugin ) ;
1083+ safe_println!( "Lint checks loaded by this crate:\n " ) ;
1084+ print_lints( loaded ) ;
10881085 }
10891086 if g > 0 {
1090- safe_println!( "Lint groups provided by plugins loaded by this crate:\n " ) ;
1091- print_lint_groups( plugin_groups , false ) ;
1087+ safe_println!( "Lint groups loaded by this crate:\n " ) ;
1088+ print_lint_groups( loaded_groups , false ) ;
10921089 }
10931090 }
10941091 }
@@ -1105,7 +1102,7 @@ pub fn describe_flag_categories(handler: &EarlyErrorHandler, matches: &Matches)
11051102 rustc_errors:: FatalError . raise( ) ;
11061103 }
11071104
1108- // Don't handle -W help here, because we might first load plugins .
1105+ // Don't handle -W help here, because we might first load additional lints .
11091106 let debug_flags = matches. opt_strs( "Z" ) ;
11101107 if debug_flags. iter( ) . any( |x| * x == "help" ) {
11111108 describe_debug_flags( ) ;
0 commit comments