diff options
| author | Ryan Prichard <ryan.prichard@gmail.com> | 2015-03-11 01:42:00 -0700 |
|---|---|---|
| committer | Ryan Prichard <ryan.prichard@gmail.com> | 2015-03-11 01:42:00 -0700 |
| commit | 61004f88d1a250d2086c0ad28f005380a6a64f9f (patch) | |
| tree | 72c28ecd5a50c3bdbb7c8ffaabb6bf810d6546f7 /src/test/codegen/stack-alloc-string-slice.rs | |
| parent | 14ce607d9b96ab3c8d5564bcddd553d6f8e175c7 (diff) | |
| download | rust-61004f88d1a250d2086c0ad28f005380a6a64f9f.tar.gz rust-61004f88d1a250d2086c0ad28f005380a6a64f9f.zip | |
Improve -Z unstable-options diagnostics and avoid an ICE
* Consumers of handle_options assume the unstable options are defined in
the getopts::Matches value if -Z unstable-options is set, but that's not
the case if there weren't any actual unstable options. Fix this by
always reparsing options when -Z unstable-options is set.
* If both argument parsing attempts fail, print the error from the second
attempt rather than the first. The error from the first is very poor
whenever unstable options are present. e.g.:
$ rustc hello.rs -Z unstable-options --show-span
error: Unrecognized option: 'show-span'.
$ rustc hello.rs -Z unstable-options --pretty --pretty
error: Unrecognized option: 'pretty'.
$ rustc hello.rs -Z unstable-options --pretty --bad-option
error: Unrecognized option: 'pretty'.
* On the second parse, add a separate pass to reject unstable options if
-Z unstable-options wasn't specified.
Fixes #21715.
r? @pnkfelix
Diffstat (limited to 'src/test/codegen/stack-alloc-string-slice.rs')
0 files changed, 0 insertions, 0 deletions
