@@ -68,6 +68,7 @@ use rustc::session::search_paths::SearchPaths;
68
68
use rustc:: session:: config:: { ErrorOutputType , RustcOptGroup , Externs , CodegenOptions } ;
69
69
use rustc:: session:: config:: { nightly_options, build_codegen_options} ;
70
70
use rustc_target:: spec:: TargetTriple ;
71
+ use rustc:: session:: config:: get_cmd_lint_options;
71
72
72
73
#[ macro_use]
73
74
pub mod externalfiles;
@@ -308,6 +309,28 @@ pub fn opts() -> Vec<RustcOptGroup> {
308
309
"disable-minification" ,
309
310
"Disable minification applied on JS files" )
310
311
} ) ,
312
+ unstable( "warn" , |o| {
313
+ o. optmulti( "W" , "warn" , "Set lint warnings" , "OPT" )
314
+ } ) ,
315
+ unstable( "allow" , |o| {
316
+ o. optmulti( "A" , "allow" , "Set lint allowed" , "OPT" )
317
+ } ) ,
318
+ unstable( "deny" , |o| {
319
+ o. optmulti( "D" , "deny" , "Set lint denied" , "OPT" )
320
+ } ) ,
321
+ unstable( "forbid" , |o| {
322
+ o. optmulti( "F" , "forbid" , "Set lint forbidden" , "OPT" )
323
+ } ) ,
324
+ unstable( "cap-lints" , |o| {
325
+ o. optmulti(
326
+ "" ,
327
+ "cap-lints" ,
328
+ "Set the most restrictive lint level. \
329
+ More restrictive lints are capped at this \
330
+ level. By default, it is at `forbid` level.",
331
+ "LEVEL" ,
332
+ )
333
+ } ) ,
311
334
]
312
335
}
313
336
@@ -640,6 +663,8 @@ where R: 'static + Send,
640
663
* x == "force-unstable-if-unmarked"
641
664
} ) ;
642
665
666
+ let ( lint_opts, describe_lints, lint_cap) = get_cmd_lint_options ( matches, error_format) ;
667
+
643
668
let ( tx, rx) = channel ( ) ;
644
669
645
670
rustc_driver:: monitor ( move || syntax:: with_globals ( move || {
@@ -648,7 +673,8 @@ where R: 'static + Send,
648
673
let ( mut krate, renderinfo) =
649
674
core:: run_core ( paths, cfgs, externs, Input :: File ( cratefile) , triple, maybe_sysroot,
650
675
display_warnings, crate_name. clone ( ) ,
651
- force_unstable_if_unmarked, edition, cg, error_format) ;
676
+ force_unstable_if_unmarked, edition, cg, error_format,
677
+ lint_opts, lint_cap, describe_lints) ;
652
678
653
679
info ! ( "finished with rustc" ) ;
654
680
0 commit comments