@@ -68,6 +68,7 @@ use rustc::session::search_paths::SearchPaths;
6868use rustc:: session:: config:: { ErrorOutputType , RustcOptGroup , Externs , CodegenOptions } ;
6969use rustc:: session:: config:: { nightly_options, build_codegen_options} ;
7070use rustc_target:: spec:: TargetTriple ;
71+ use rustc:: session:: config:: get_cmd_lint_options;
7172
7273#[ macro_use]
7374pub mod externalfiles;
@@ -308,6 +309,28 @@ pub fn opts() -> Vec<RustcOptGroup> {
308309 "disable-minification" ,
309310 "Disable minification applied on JS files" )
310311 } ) ,
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+ } ) ,
311334 ]
312335}
313336
@@ -640,6 +663,8 @@ where R: 'static + Send,
640663 * x == "force-unstable-if-unmarked"
641664 } ) ;
642665
666+ let ( lint_opts, describe_lints, lint_cap) = get_cmd_lint_options ( matches, error_format) ;
667+
643668 let ( tx, rx) = channel ( ) ;
644669
645670 rustc_driver:: monitor ( move || syntax:: with_globals ( move || {
@@ -648,7 +673,8 @@ where R: 'static + Send,
648673 let ( mut krate, renderinfo) =
649674 core:: run_core ( paths, cfgs, externs, Input :: File ( cratefile) , triple, maybe_sysroot,
650675 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) ;
652678
653679 info ! ( "finished with rustc" ) ;
654680
0 commit comments