mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
rustdoc: error out on --test with --emit
These options don't behave reasonably when combined right now, and there are no tests and no docs for how they should. For the short term, make this a fatal error. If we decide to assign this some semantics, then we can do that at any time.
This commit is contained in:
@@ -462,8 +462,13 @@ fn println_condition(condition: Condition) {
|
||||
return None;
|
||||
}
|
||||
|
||||
let should_test = matches.opt_present("test");
|
||||
|
||||
let mut emit = FxIndexMap::<_, EmitType>::default();
|
||||
for list in matches.opt_strs("emit") {
|
||||
if should_test {
|
||||
dcx.fatal("the `--test` flag and the `--emit` flag are not supported together");
|
||||
}
|
||||
for kind in list.split(',') {
|
||||
match kind.parse() {
|
||||
Ok(kind) => {
|
||||
@@ -634,7 +639,6 @@ fn println_condition(condition: Condition) {
|
||||
let test_args: Vec<String> =
|
||||
test_args.iter().flat_map(|s| s.split_whitespace()).map(|s| s.to_string()).collect();
|
||||
|
||||
let should_test = matches.opt_present("test");
|
||||
let no_run = matches.opt_present("no-run");
|
||||
|
||||
if !should_test && no_run {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
//@ compile-flags:--test --emit=dep-info -Z unstable-options
|
||||
//@ check-fail
|
||||
//~? ERROR the `--test` flag and the `--emit` flag
|
||||
|
||||
//! This example intentionally left blank.
|
||||
@@ -0,0 +1,2 @@
|
||||
error: the `--test` flag and the `--emit` flag are not supported together
|
||||
|
||||
Reference in New Issue
Block a user