2020#[ macro_use]
2121extern crate tracing;
2222
23- pub extern crate rustc_plugin_impl as plugin;
24-
2523use rustc_ast as ast;
2624use rustc_codegen_ssa:: { traits:: CodegenBackend , CodegenErrors , CodegenResults } ;
2725use rustc_data_structures:: profiling:: {
@@ -132,7 +130,6 @@ pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[
132130 rustc_monomorphize:: DEFAULT_LOCALE_RESOURCE ,
133131 rustc_parse:: DEFAULT_LOCALE_RESOURCE ,
134132 rustc_passes:: DEFAULT_LOCALE_RESOURCE ,
135- rustc_plugin_impl:: DEFAULT_LOCALE_RESOURCE ,
136133 rustc_privacy:: DEFAULT_LOCALE_RESOURCE ,
137134 rustc_query_system:: DEFAULT_LOCALE_RESOURCE ,
138135 rustc_resolve:: DEFAULT_LOCALE_RESOURCE ,
@@ -994,16 +991,14 @@ the command line flag directly.
994991}
995992
996993/// Write to stdout lint command options, together with a list of all available lints
997- pub fn describe_lints( sess: & Session , lint_store: & LintStore , loaded_plugins : bool ) {
994+ pub fn describe_lints( sess: & Session , lint_store: & LintStore , loaded_lints : bool ) {
998995 safe_println!(
999996 "
1000997Available lint options:
1001998 -W <foo> Warn about <foo>
1002- -A <foo> \
1003- Allow <foo>
999+ -A <foo> Allow <foo>
10041000 -D <foo> Deny <foo>
1005- -F <foo> Forbid <foo> \
1006- (deny <foo> and all attempts to override)
1001+ -F <foo> Forbid <foo> (deny <foo> and all attempts to override)
10071002
10081003"
10091004 ) ;
@@ -1022,18 +1017,18 @@ Available lint options:
10221017 lints
10231018 }
10241019
1025- let ( plugin , builtin) : ( Vec <_>, _) =
1026- lint_store. get_lints( ) . iter( ) . cloned( ) . partition( |& lint| lint. is_plugin ) ;
1027- let plugin = sort_lints( sess, plugin ) ;
1020+ let ( loaded , builtin) : ( Vec <_>, _) =
1021+ lint_store. get_lints( ) . iter( ) . cloned( ) . partition( |& lint| lint. is_loaded ) ;
1022+ let loaded = sort_lints( sess, loaded ) ;
10281023 let builtin = sort_lints( sess, builtin) ;
10291024
1030- let ( plugin_groups , builtin_groups) : ( Vec <_>, _) =
1025+ let ( loaded_groups , builtin_groups) : ( Vec <_>, _) =
10311026 lint_store. get_lint_groups( ) . partition( |& ( .., p) | p) ;
1032- let plugin_groups = sort_lint_groups( plugin_groups ) ;
1027+ let loaded_groups = sort_lint_groups( loaded_groups ) ;
10331028 let builtin_groups = sort_lint_groups( builtin_groups) ;
10341029
10351030 let max_name_len =
1036- plugin . iter( ) . chain( & builtin) . map( |& s| s. name. chars( ) . count( ) ) . max( ) . unwrap_or( 0 ) ;
1031+ loaded . iter( ) . chain( & builtin) . map( |& s| s. name. chars( ) . count( ) ) . max( ) . unwrap_or( 0 ) ;
10371032 let padded = |x: & str | {
10381033 let mut s = " " . repeat( max_name_len - x. chars( ) . count( ) ) ;
10391034 s. push_str( x) ;
@@ -1061,7 +1056,7 @@ Available lint options:
10611056
10621057 let max_name_len = max(
10631058 "warnings" . len( ) ,
1064- plugin_groups
1059+ loaded_groups
10651060 . iter( )
10661061 . chain( & builtin_groups)
10671062 . map( |& ( s, _) | s. chars( ) . count( ) )
@@ -1099,20 +1094,22 @@ Available lint options:
10991094
11001095 print_lint_groups( builtin_groups, true ) ;
11011096
1102- match ( loaded_plugins , plugin . len( ) , plugin_groups . len( ) ) {
1097+ match ( loaded_lints , loaded . len( ) , loaded_groups . len( ) ) {
11031098 ( false , 0 , _) | ( false , _, 0 ) => {
1104- safe_println!( "Lint tools like Clippy can provide additional lints and lint groups." ) ;
1099+ safe_println!( "Lint tools like Clippy can load additional lints and lint groups." ) ;
1100+ }
1101+ ( false , ..) => panic!( "didn't load additional lints but got them anyway!" ) ,
1102+ ( true , 0 , 0 ) => {
1103+ safe_println!( "This crate does not load any additional lints or lint groups." )
11051104 }
1106- ( false , ..) => panic!( "didn't load lint plugins but got them anyway!" ) ,
1107- ( true , 0 , 0 ) => safe_println!( "This crate does not load any lint plugins or lint groups." ) ,
11081105 ( true , l, g) => {
11091106 if l > 0 {
1110- safe_println!( "Lint checks provided by plugins loaded by this crate:\n " ) ;
1111- print_lints( plugin ) ;
1107+ safe_println!( "Lint checks loaded by this crate:\n " ) ;
1108+ print_lints( loaded ) ;
11121109 }
11131110 if g > 0 {
1114- safe_println!( "Lint groups provided by plugins loaded by this crate:\n " ) ;
1115- print_lint_groups( plugin_groups , false ) ;
1111+ safe_println!( "Lint groups loaded by this crate:\n " ) ;
1112+ print_lint_groups( loaded_groups , false ) ;
11161113 }
11171114 }
11181115 }
@@ -1129,7 +1126,7 @@ pub fn describe_flag_categories(handler: &EarlyErrorHandler, matches: &Matches)
11291126 rustc_errors:: FatalError . raise( ) ;
11301127 }
11311128
1132- // Don't handle -W help here, because we might first load plugins .
1129+ // Don't handle -W help here, because we might first load additional lints .
11331130 let debug_flags = matches. opt_strs( "Z" ) ;
11341131 if debug_flags. iter( ) . any( |x| * x == "help" ) {
11351132 describe_debug_flags( ) ;
0 commit comments