Skip to content

Commit 0b54351

Browse files
Ensure -V --verbose processes both codegen_backend and codegen-backend
1 parent 36b2163 commit 0b54351

File tree

1 file changed

+4
-1
lines changed
  • compiler/rustc_driver_impl/src

1 file changed

+4
-1
lines changed

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,10 @@ fn get_backend_from_raw_matches(
11121112
matches: &Matches,
11131113
) -> Box<dyn CodegenBackend> {
11141114
let debug_flags = matches.opt_strs("Z");
1115-
let backend_name = debug_flags.iter().find_map(|x| x.strip_prefix("codegen-backend="));
1115+
let backend_name = debug_flags.iter().find_map(|x| {
1116+
x.strip_prefix("codegen")
1117+
.and_then(|x| x.strip_prefix("-backend=").or_else(|| x.strip_prefix("_backend=")))
1118+
});
11161119
let target = parse_target_triple(early_dcx, matches);
11171120
let sysroot = filesearch::materialize_sysroot(matches.opt_str("sysroot").map(PathBuf::from));
11181121
let target = config::build_target_config(early_dcx, &target, &sysroot);

0 commit comments

Comments
 (0)