@@ -274,6 +274,8 @@ options:
274
274
--test build test harness
275
275
--gc garbage collect shared data (experimental/temporary)
276
276
--stack-growth perform stack checks (experimental)
277
+ --warn-unused-imports
278
+ warn about unnecessary imports
277
279
278
280
" ) ;
279
281
}
@@ -397,6 +399,7 @@ fn build_session_options(match: getopts::match)
397
399
let test = opt_present( match , "test" ) ;
398
400
let do_gc = opt_present( match , "gc" ) ;
399
401
let stack_growth = opt_present( match , "stack-growth" ) ;
402
+ let warn_unused_imports = opt_present ( match , "warn-unused-imports" ) ;
400
403
let sopts: @session:: options =
401
404
@{ library: library,
402
405
static : static ,
@@ -417,7 +420,8 @@ fn build_session_options(match: getopts::match)
417
420
no_trans : no_trans ,
418
421
do_gc : do_gc ,
419
422
stack_growth : stack_growth ,
420
- no_asm_comments : no_asm_comments } ;
423
+ no_asm_comments : no_asm_comments ,
424
+ warn_unused_imports : warn_unused_imports } ;
421
425
ret sopts;
422
426
}
423
427
@@ -457,7 +461,8 @@ fn opts() -> [getopts::opt] {
457
461
optmulti ( "cfg" ) , optflag ( "test" ) ,
458
462
optflag ( "lib" ) , optflag ( "static" ) , optflag ( "gc" ) ,
459
463
optflag ( "stack-growth" ) ,
460
- optflag ( "no-asm-comments" ) ] ;
464
+ optflag ( "no-asm-comments" ) ,
465
+ optflag ( "warn-unused-imports" ) ] ;
461
466
}
462
467
463
468
fn build_output_filenames ( ifile : str , ofile : option:: t < str > ,
0 commit comments