enable unsafe checking but only with a flag --check-unsafe
This commit is contained in:
parent
cbe8da0655
commit
f3c68e7238
3 changed files with 25 additions and 14 deletions
|
|
@ -264,6 +264,7 @@ options:
|
|||
--test build test harness
|
||||
--gc garbage collect shared data (experimental/temporary)
|
||||
--stack-growth perform stack checks (experimental)
|
||||
--check-unsafe disallow unsafe actions in non-unsafe functions (temporary option)
|
||||
|
||||
");
|
||||
}
|
||||
|
|
@ -322,6 +323,7 @@ fn build_session_options(match: getopts::match)
|
|||
|
||||
let parse_only = opt_present(match, "parse-only");
|
||||
let no_trans = opt_present(match, "no-trans");
|
||||
let check_unsafe = opt_present(match, "check-unsafe");
|
||||
|
||||
let output_type =
|
||||
if parse_only || no_trans {
|
||||
|
|
@ -393,7 +395,8 @@ fn build_session_options(match: getopts::match)
|
|||
parse_only: parse_only,
|
||||
no_trans: no_trans,
|
||||
do_gc: do_gc,
|
||||
stack_growth: stack_growth};
|
||||
stack_growth: stack_growth,
|
||||
check_unsafe: check_unsafe};
|
||||
ret sopts;
|
||||
}
|
||||
|
||||
|
|
@ -432,7 +435,7 @@ fn opts() -> [getopts::opt] {
|
|||
optflag("no-typestate"), optflag("noverify"),
|
||||
optmulti("cfg"), optflag("test"),
|
||||
optflag("lib"), optflag("static"), optflag("gc"),
|
||||
optflag("stack-growth")];
|
||||
optflag("stack-growth"), optflag("check-unsafe")];
|
||||
}
|
||||
|
||||
fn main(args: [str]) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ type options =
|
|||
parse_only: bool,
|
||||
no_trans: bool,
|
||||
do_gc: bool,
|
||||
stack_growth: bool};
|
||||
stack_growth: bool,
|
||||
check_unsafe: bool};
|
||||
|
||||
type crate_metadata = {name: str, data: [u8]};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue