20
20
#[ macro_use]
21
21
extern crate tracing;
22
22
23
- pub extern crate rustc_plugin_impl as plugin;
24
-
25
23
use rustc_ast as ast;
26
24
use rustc_codegen_ssa:: { traits:: CodegenBackend , CodegenErrors , CodegenResults } ;
27
25
use rustc_data_structures:: profiling:: {
@@ -132,7 +130,6 @@ pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[
132
130
rustc_monomorphize:: DEFAULT_LOCALE_RESOURCE ,
133
131
rustc_parse:: DEFAULT_LOCALE_RESOURCE ,
134
132
rustc_passes:: DEFAULT_LOCALE_RESOURCE ,
135
- rustc_plugin_impl:: DEFAULT_LOCALE_RESOURCE ,
136
133
rustc_privacy:: DEFAULT_LOCALE_RESOURCE ,
137
134
rustc_query_system:: DEFAULT_LOCALE_RESOURCE ,
138
135
rustc_resolve:: DEFAULT_LOCALE_RESOURCE ,
@@ -994,16 +991,14 @@ the command line flag directly.
994
991
}
995
992
996
993
/// 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 ) {
998
995
safe_println!(
999
996
"
1000
997
Available lint options:
1001
998
-W <foo> Warn about <foo>
1002
- -A <foo> \
1003
- Allow <foo>
999
+ -A <foo> Allow <foo>
1004
1000
-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)
1007
1002
1008
1003
"
1009
1004
) ;
@@ -1022,18 +1017,18 @@ Available lint options:
1022
1017
lints
1023
1018
}
1024
1019
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 ) ;
1028
1023
let builtin = sort_lints( sess, builtin) ;
1029
1024
1030
- let ( plugin_groups , builtin_groups) : ( Vec <_>, _) =
1025
+ let ( loaded_groups , builtin_groups) : ( Vec <_>, _) =
1031
1026
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 ) ;
1033
1028
let builtin_groups = sort_lint_groups( builtin_groups) ;
1034
1029
1035
1030
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 ) ;
1037
1032
let padded = |x: & str | {
1038
1033
let mut s = " " . repeat( max_name_len - x. chars( ) . count( ) ) ;
1039
1034
s. push_str( x) ;
@@ -1061,7 +1056,7 @@ Available lint options:
1061
1056
1062
1057
let max_name_len = max(
1063
1058
"warnings" . len( ) ,
1064
- plugin_groups
1059
+ loaded_groups
1065
1060
. iter( )
1066
1061
. chain( & builtin_groups)
1067
1062
. map( |& ( s, _) | s. chars( ) . count( ) )
@@ -1099,20 +1094,22 @@ Available lint options:
1099
1094
1100
1095
print_lint_groups( builtin_groups, true ) ;
1101
1096
1102
- match ( loaded_plugins , plugin . len( ) , plugin_groups . len( ) ) {
1097
+ match ( loaded_lints , loaded . len( ) , loaded_groups . len( ) ) {
1103
1098
( 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." )
1105
1104
}
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." ) ,
1108
1105
( true , l, g) => {
1109
1106
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 ) ;
1112
1109
}
1113
1110
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 ) ;
1116
1113
}
1117
1114
}
1118
1115
}
@@ -1129,7 +1126,7 @@ pub fn describe_flag_categories(handler: &EarlyErrorHandler, matches: &Matches)
1129
1126
rustc_errors:: FatalError . raise( ) ;
1130
1127
}
1131
1128
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 .
1133
1130
let debug_flags = matches. opt_strs( "Z" ) ;
1134
1131
if debug_flags. iter( ) . any( |x| * x == "help" ) {
1135
1132
describe_debug_flags( ) ;
0 commit comments