Rollup merge of #111251 - mj10021:issue-109502-follow-up, r=oli-obk

Issue 109502 follow up, remove unnecessary Vec::new() from compile_test()

As mentioned in comment on PR #110773 , adding a separate function to pass the test passes into the `dump-mir` is a bit nicer
This commit is contained in:
Yuki Okushi 2023-05-06 09:09:34 +09:00 committed by GitHub
commit d97cef099e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -319,8 +319,7 @@ fn check_if_test_should_compile(&self, proc_res: &ProcRes, pm: Option<PassMode>)
fn run_cfail_test(&self) {
let pm = self.pass_mode();
let proc_res =
self.compile_test(WillExecute::No, self.should_emit_metadata(pm), Vec::new());
let proc_res = self.compile_test(WillExecute::No, self.should_emit_metadata(pm));
self.check_if_test_should_compile(&proc_res, pm);
self.check_no_compiler_crash(&proc_res, self.props.should_ice);
@ -348,7 +347,7 @@ fn run_cfail_test(&self) {
fn run_rfail_test(&self) {
let pm = self.pass_mode();
let should_run = self.run_if_enabled();
let proc_res = self.compile_test(should_run, self.should_emit_metadata(pm), Vec::new());
let proc_res = self.compile_test(should_run, self.should_emit_metadata(pm));
if !proc_res.status.success() {
self.fatal_proc_rec("compilation failed!", &proc_res);
@ -396,7 +395,7 @@ fn check_correct_failure_status(&self, proc_res: &ProcRes) {
fn run_cpass_test(&self) {
let emit_metadata = self.should_emit_metadata(self.pass_mode());
let proc_res = self.compile_test(WillExecute::No, emit_metadata, Vec::new());
let proc_res = self.compile_test(WillExecute::No, emit_metadata);
if !proc_res.status.success() {
self.fatal_proc_rec("compilation failed!", &proc_res);
@ -411,7 +410,7 @@ fn run_cpass_test(&self) {
fn run_rpass_test(&self) {
let emit_metadata = self.should_emit_metadata(self.pass_mode());
let should_run = self.run_if_enabled();
let proc_res = self.compile_test(should_run, emit_metadata, Vec::new());
let proc_res = self.compile_test(should_run, emit_metadata);
if !proc_res.status.success() {
self.fatal_proc_rec("compilation failed!", &proc_res);
@ -441,7 +440,7 @@ fn run_valgrind_test(&self) {
}
let should_run = self.run_if_enabled();
let mut proc_res = self.compile_test(should_run, Emit::None, Vec::new());
let mut proc_res = self.compile_test(should_run, Emit::None);
if !proc_res.status.success() {
self.fatal_proc_rec("compilation failed!", &proc_res);
@ -687,7 +686,7 @@ fn run_debuginfo_cdb_test_no_opt(&self) {
// compile test file (it should have 'compile-flags:-g' in the header)
let should_run = self.run_if_enabled();
let compile_result = self.compile_test(should_run, Emit::None, Vec::new());
let compile_result = self.compile_test(should_run, Emit::None);
if !compile_result.status.success() {
self.fatal_proc_rec("compilation failed!", &compile_result);
}
@ -807,7 +806,7 @@ fn run_debuginfo_gdb_test_no_opt(&self) {
// compile test file (it should have 'compile-flags:-g' in the header)
let should_run = self.run_if_enabled();
let compiler_run_result = self.compile_test(should_run, Emit::None, Vec::new());
let compiler_run_result = self.compile_test(should_run, Emit::None);
if !compiler_run_result.status.success() {
self.fatal_proc_rec("compilation failed!", &compiler_run_result);
}
@ -1044,7 +1043,7 @@ fn run_debuginfo_lldb_test(&self) {
fn run_debuginfo_lldb_test_no_opt(&self) {
// compile test file (it should have 'compile-flags:-g' in the header)
let should_run = self.run_if_enabled();
let compile_result = self.compile_test(should_run, Emit::None, Vec::new());
let compile_result = self.compile_test(should_run, Emit::None);
if !compile_result.status.success() {
self.fatal_proc_rec("compilation failed!", &compile_result);
}
@ -1483,7 +1482,16 @@ fn should_emit_metadata(&self, pm: Option<PassMode>) -> Emit {
}
}
fn compile_test(&self, will_execute: WillExecute, emit: Emit, passes: Vec<String>) -> ProcRes {
fn compile_test(&self, will_execute: WillExecute, emit: Emit) -> ProcRes {
self.compile_test_general(will_execute, emit, self.props.local_pass_mode(), Vec::new())
}
fn compile_test_with_passes(
&self,
will_execute: WillExecute,
emit: Emit,
passes: Vec<String>,
) -> ProcRes {
self.compile_test_general(will_execute, emit, self.props.local_pass_mode(), passes)
}
@ -2791,7 +2799,7 @@ fn check_rustdoc_test_option(&self, res: ProcRes) {
fn run_codegen_units_test(&self) {
assert!(self.revision.is_none(), "revisions not relevant here");
let proc_res = self.compile_test(WillExecute::No, Emit::None, Vec::new());
let proc_res = self.compile_test(WillExecute::No, Emit::None);
if !proc_res.status.success() {
self.fatal_proc_rec("compilation failed!", &proc_res);
@ -3340,7 +3348,7 @@ fn run_ui_test(&self) {
let pm = self.pass_mode();
let should_run = self.should_run(pm);
let emit_metadata = self.should_emit_metadata(pm);
let proc_res = self.compile_test(should_run, emit_metadata, Vec::new());
let proc_res = self.compile_test(should_run, emit_metadata);
self.check_if_test_should_compile(&proc_res, pm);
// if the user specified a format in the ui test
@ -3523,7 +3531,7 @@ fn run_mir_opt_test(&self) {
let emit_metadata = self.should_emit_metadata(pm);
let passes = self.get_passes();
let proc_res = self.compile_test(should_run, emit_metadata, passes);
let proc_res = self.compile_test_with_passes(should_run, emit_metadata, passes);
self.check_mir_dump();
if !proc_res.status.success() {
self.fatal_proc_rec("compilation failed!", &proc_res);