.TP
\fB--stack-growth\fR:
\fBEXPERIMENTAL\fR. Perform stack growth checks.
+.TP
+\fB--warn-unused-imports\fR:
+Warn about unnecessary imports.
.SH "BUGS"
See \fBhttps://github.com/graydon/rust/issues\fR for a list of known bugs.
.SH "AUTHOR"
--test build test harness
--gc garbage collect shared data (experimental/temporary)
--stack-growth perform stack checks (experimental)
+ --warn-unused-imports
+ warn about unnecessary imports
");
}
let test = opt_present(match, "test");
let do_gc = opt_present(match, "gc");
let stack_growth = opt_present(match, "stack-growth");
+ let warn_unused_imports = opt_present(match, "warn-unused-imports");
let sopts: @session::options =
@{library: library,
static: static,
no_trans: no_trans,
do_gc: do_gc,
stack_growth: stack_growth,
- no_asm_comments: no_asm_comments};
+ no_asm_comments: no_asm_comments,
+ warn_unused_imports: warn_unused_imports};
ret sopts;
}
optmulti("cfg"), optflag("test"),
optflag("lib"), optflag("static"), optflag("gc"),
optflag("stack-growth"),
- optflag("no-asm-comments")];
+ optflag("no-asm-comments"),
+ optflag("warn-unused-imports")];
}
fn build_output_filenames(ifile: str, ofile: option::t<str>,
check_for_collisions(e, *crate);
check_bad_exports(e);
resolve_names(e, crate);
- check_unused_imports(e);
+ if sess.get_opts().warn_unused_imports {
+ check_unused_imports(e);
+ }
ret {def_map: e.def_map, ext_map: e.ext_map};
}