@@ -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;
@@ -304,6 +305,28 @@ pub fn opts() -> Vec<RustcOptGroup> {
304
305
"disable-minification" ,
305
306
"Disable minification applied on JS files" )
306
307
} ) ,
308
+ unstable( "warn" , |o| {
309
+ o. optmulti( "W" , "warn" , "Set lint warnings" , "OPT" )
310
+ } ) ,
311
+ unstable( "allow" , |o| {
312
+ o. optmulti( "A" , "allow" , "Set lint allowed" , "OPT" )
313
+ } ) ,
314
+ unstable( "deny" , |o| {
315
+ o. optmulti( "D" , "deny" , "Set lint denied" , "OPT" )
316
+ } ) ,
317
+ unstable( "forbid" , |o| {
318
+ o. optmulti( "F" , "forbid" , "Set lint forbidden" , "OPT" )
319
+ } ) ,
320
+ unstable( "cap-lints" , |o| {
321
+ o. optmulti(
322
+ "" ,
323
+ "cap-lints" ,
324
+ "Set the most restrictive lint level. \
325
+ More restrictive lints are capped at this \
326
+ level. By default, it is at `forbid` level.",
327
+ "LEVEL" ,
328
+ )
329
+ } ) ,
307
330
]
308
331
}
309
332
@@ -636,6 +659,8 @@ where R: 'static + Send,
636
659
* x == "force-unstable-if-unmarked"
637
660
} ) ;
638
661
662
+ let ( lint_opts, describe_lints, lint_cap) = get_cmd_lint_options ( matches, error_format) ;
663
+
639
664
let ( tx, rx) = channel ( ) ;
640
665
641
666
rustc_driver:: monitor ( move || syntax:: with_globals ( move || {
@@ -644,7 +669,8 @@ where R: 'static + Send,
644
669
let ( mut krate, renderinfo) =
645
670
core:: run_core ( paths, cfgs, externs, Input :: File ( cratefile) , triple, maybe_sysroot,
646
671
display_warnings, crate_name. clone ( ) ,
647
- force_unstable_if_unmarked, edition, cg, error_format) ;
672
+ force_unstable_if_unmarked, edition, cg, error_format,
673
+ lint_opts, lint_cap, describe_lints) ;
648
674
649
675
info ! ( "finished with rustc" ) ;
650
676
0 commit comments