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:: {
@@ -131,7 +129,6 @@ pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[
131
129
rustc_monomorphize:: DEFAULT_LOCALE_RESOURCE ,
132
130
rustc_parse:: DEFAULT_LOCALE_RESOURCE ,
133
131
rustc_passes:: DEFAULT_LOCALE_RESOURCE ,
134
- rustc_plugin_impl:: DEFAULT_LOCALE_RESOURCE ,
135
132
rustc_privacy:: DEFAULT_LOCALE_RESOURCE ,
136
133
rustc_query_system:: DEFAULT_LOCALE_RESOURCE ,
137
134
rustc_resolve:: DEFAULT_LOCALE_RESOURCE ,
@@ -993,16 +990,14 @@ the command line flag directly.
993
990
}
994
991
995
992
/// Write to stdout lint command options, together with a list of all available lints
996
- pub fn describe_lints( sess: & Session , lint_store: & LintStore , loaded_plugins : bool ) {
993
+ pub fn describe_lints( sess: & Session , lint_store: & LintStore , loaded_lints : bool ) {
997
994
safe_println!(
998
995
"
999
996
Available lint options:
1000
997
-W <foo> Warn about <foo>
1001
- -A <foo> \
1002
- Allow <foo>
998
+ -A <foo> Allow <foo>
1003
999
-D <foo> Deny <foo>
1004
- -F <foo> Forbid <foo> \
1005
- (deny <foo> and all attempts to override)
1000
+ -F <foo> Forbid <foo> (deny <foo> and all attempts to override)
1006
1001
1007
1002
"
1008
1003
) ;
@@ -1021,18 +1016,18 @@ Available lint options:
1021
1016
lints
1022
1017
}
1023
1018
1024
- let ( plugin , builtin) : ( Vec <_>, _) =
1025
- lint_store. get_lints( ) . iter( ) . cloned( ) . partition( |& lint| lint. is_plugin ) ;
1026
- let plugin = sort_lints( sess, plugin ) ;
1019
+ let ( loaded , builtin) : ( Vec <_>, _) =
1020
+ lint_store. get_lints( ) . iter( ) . cloned( ) . partition( |& lint| lint. is_loaded ) ;
1021
+ let loaded = sort_lints( sess, loaded ) ;
1027
1022
let builtin = sort_lints( sess, builtin) ;
1028
1023
1029
- let ( plugin_groups , builtin_groups) : ( Vec <_>, _) =
1024
+ let ( loaded_groups , builtin_groups) : ( Vec <_>, _) =
1030
1025
lint_store. get_lint_groups( ) . partition( |& ( .., p) | p) ;
1031
- let plugin_groups = sort_lint_groups( plugin_groups ) ;
1026
+ let loaded_groups = sort_lint_groups( loaded_groups ) ;
1032
1027
let builtin_groups = sort_lint_groups( builtin_groups) ;
1033
1028
1034
1029
let max_name_len =
1035
- plugin . iter( ) . chain( & builtin) . map( |& s| s. name. chars( ) . count( ) ) . max( ) . unwrap_or( 0 ) ;
1030
+ loaded . iter( ) . chain( & builtin) . map( |& s| s. name. chars( ) . count( ) ) . max( ) . unwrap_or( 0 ) ;
1036
1031
let padded = |x: & str | {
1037
1032
let mut s = " " . repeat( max_name_len - x. chars( ) . count( ) ) ;
1038
1033
s. push_str( x) ;
@@ -1060,7 +1055,7 @@ Available lint options:
1060
1055
1061
1056
let max_name_len = max(
1062
1057
"warnings" . len( ) ,
1063
- plugin_groups
1058
+ loaded_groups
1064
1059
. iter( )
1065
1060
. chain( & builtin_groups)
1066
1061
. map( |& ( s, _) | s. chars( ) . count( ) )
@@ -1098,20 +1093,22 @@ Available lint options:
1098
1093
1099
1094
print_lint_groups( builtin_groups, true ) ;
1100
1095
1101
- match ( loaded_plugins , plugin . len( ) , plugin_groups . len( ) ) {
1096
+ match ( loaded_lints , loaded . len( ) , loaded_groups . len( ) ) {
1102
1097
( false , 0 , _) | ( false , _, 0 ) => {
1103
- safe_println!( "Lint tools like Clippy can provide additional lints and lint groups." ) ;
1098
+ safe_println!( "Lint tools like Clippy can load additional lints and lint groups." ) ;
1099
+ }
1100
+ ( false , ..) => panic!( "didn't load additional lints but got them anyway!" ) ,
1101
+ ( true , 0 , 0 ) => {
1102
+ safe_println!( "This crate does not load any additional lints or lint groups." )
1104
1103
}
1105
- ( false , ..) => panic!( "didn't load lint plugins but got them anyway!" ) ,
1106
- ( true , 0 , 0 ) => safe_println!( "This crate does not load any lint plugins or lint groups." ) ,
1107
1104
( true , l, g) => {
1108
1105
if l > 0 {
1109
- safe_println!( "Lint checks provided by plugins loaded by this crate:\n " ) ;
1110
- print_lints( plugin ) ;
1106
+ safe_println!( "Lint checks loaded by this crate:\n " ) ;
1107
+ print_lints( loaded ) ;
1111
1108
}
1112
1109
if g > 0 {
1113
- safe_println!( "Lint groups provided by plugins loaded by this crate:\n " ) ;
1114
- print_lint_groups( plugin_groups , false ) ;
1110
+ safe_println!( "Lint groups loaded by this crate:\n " ) ;
1111
+ print_lint_groups( loaded_groups , false ) ;
1115
1112
}
1116
1113
}
1117
1114
}
@@ -1128,7 +1125,7 @@ pub fn describe_flag_categories(handler: &EarlyErrorHandler, matches: &Matches)
1128
1125
rustc_errors:: FatalError . raise( ) ;
1129
1126
}
1130
1127
1131
- // Don't handle -W help here, because we might first load plugins .
1128
+ // Don't handle -W help here, because we might first load additional lints .
1132
1129
let debug_flags = matches. opt_strs( "Z" ) ;
1133
1130
if debug_flags. iter( ) . any( |x| * x == "help" ) {
1134
1131
describe_debug_flags( ) ;
0 commit comments