17
17
#[ macro_use]
18
18
extern crate tracing;
19
19
20
- pub extern crate rustc_plugin_impl as plugin;
21
-
22
20
use rustc_ast as ast;
23
21
use rustc_codegen_ssa:: { traits:: CodegenBackend , CodegenErrors , CodegenResults } ;
24
22
use rustc_data_structures:: profiling:: {
@@ -129,7 +127,6 @@ pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[
129
127
rustc_monomorphize:: DEFAULT_LOCALE_RESOURCE ,
130
128
rustc_parse:: DEFAULT_LOCALE_RESOURCE ,
131
129
rustc_passes:: DEFAULT_LOCALE_RESOURCE ,
132
- rustc_plugin_impl:: DEFAULT_LOCALE_RESOURCE ,
133
130
rustc_privacy:: DEFAULT_LOCALE_RESOURCE ,
134
131
rustc_query_system:: DEFAULT_LOCALE_RESOURCE ,
135
132
rustc_resolve:: DEFAULT_LOCALE_RESOURCE ,
@@ -970,16 +967,14 @@ the command line flag directly.
970
967
}
971
968
972
969
/// 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 ) {
974
971
safe_println!(
975
972
"
976
973
Available lint options:
977
974
-W <foo> Warn about <foo>
978
- -A <foo> \
979
- Allow <foo>
975
+ -A <foo> Allow <foo>
980
976
-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)
983
978
984
979
"
985
980
) ;
@@ -998,18 +993,18 @@ Available lint options:
998
993
lints
999
994
}
1000
995
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 ) ;
1004
999
let builtin = sort_lints( sess, builtin) ;
1005
1000
1006
- let ( plugin_groups , builtin_groups) : ( Vec <_>, _) =
1001
+ let ( loaded_groups , builtin_groups) : ( Vec <_>, _) =
1007
1002
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 ) ;
1009
1004
let builtin_groups = sort_lint_groups( builtin_groups) ;
1010
1005
1011
1006
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 ) ;
1013
1008
let padded = |x: & str | {
1014
1009
let mut s = " " . repeat( max_name_len - x. chars( ) . count( ) ) ;
1015
1010
s. push_str( x) ;
@@ -1037,7 +1032,7 @@ Available lint options:
1037
1032
1038
1033
let max_name_len = max(
1039
1034
"warnings" . len( ) ,
1040
- plugin_groups
1035
+ loaded_groups
1041
1036
. iter( )
1042
1037
. chain( & builtin_groups)
1043
1038
. map( |& ( s, _) | s. chars( ) . count( ) )
@@ -1075,20 +1070,22 @@ Available lint options:
1075
1070
1076
1071
print_lint_groups( builtin_groups, true ) ;
1077
1072
1078
- match ( loaded_plugins , plugin . len( ) , plugin_groups . len( ) ) {
1073
+ match ( loaded_lints , loaded . len( ) , loaded_groups . len( ) ) {
1079
1074
( 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." )
1081
1080
}
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." ) ,
1084
1081
( true , l, g) => {
1085
1082
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 ) ;
1088
1085
}
1089
1086
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 ) ;
1092
1089
}
1093
1090
}
1094
1091
}
@@ -1105,7 +1102,7 @@ pub fn describe_flag_categories(handler: &EarlyErrorHandler, matches: &Matches)
1105
1102
rustc_errors:: FatalError . raise( ) ;
1106
1103
}
1107
1104
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 .
1109
1106
let debug_flags = matches. opt_strs( "Z" ) ;
1110
1107
if debug_flags. iter( ) . any( |x| * x == "help" ) {
1111
1108
describe_debug_flags( ) ;
0 commit comments