Skip to content

Commit a0a5c42

Browse files
committed
Auto merge of rust-lang#134738 - clubby789:forbid-output-ui, r=jieyouxu
compiletest: Support `forbid-output` in UI tests The `forbid-output` directive is currently only run in incremental tests (although no incremental tests use it). There are some UI tests 'using' it, but it's doing nothing 😄 Let's fix this Will also PR the dev guide to note this. dev-guide PR: rust-lang/rustc-dev-guide#2171
2 parents 68b9e4f + 5a8ecc9 commit a0a5c42

File tree

1 file changed

+4
-2
lines changed
  • src/tools/compiletest/src/runtest

1 file changed

+4
-2
lines changed

src/tools/compiletest/src/runtest/ui.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,13 @@ impl TestCx<'_> {
145145
self.fatal_proc_rec("test run succeeded!", &proc_res);
146146
}
147147

148+
let output_to_check = self.get_output(&proc_res);
148149
if !self.props.error_patterns.is_empty() || !self.props.regex_error_patterns.is_empty()
149150
{
150151
// "// error-pattern" comments
151-
let output_to_check = self.get_output(&proc_res);
152152
self.check_all_error_patterns(&output_to_check, &proc_res, pm);
153153
}
154+
self.check_forbid_output(&output_to_check, &proc_res)
154155
}
155156

156157
debug!(
@@ -181,11 +182,12 @@ impl TestCx<'_> {
181182
);
182183
self.fatal(&msg);
183184
}
185+
let output_to_check = self.get_output(&proc_res);
184186
if check_patterns {
185187
// "// error-pattern" comments
186-
let output_to_check = self.get_output(&proc_res);
187188
self.check_all_error_patterns(&output_to_check, &proc_res, pm);
188189
}
190+
self.check_forbid_output(&output_to_check, &proc_res);
189191

190192
if self.props.run_rustfix && self.config.compare_mode.is_none() {
191193
// And finally, compile the fixed code and make sure it both

0 commit comments

Comments
 (0)