1. When the invalid condition is hit, write out the relevant variables too
2. In compile-fail/parse-fail tests, check for ICE first, so the invalid
error patterns won't mask our ICE output.
if names.is_empty() {
import_directive_subclass_to_string(subclass)
} else {
+ // FIXME: Remove this entire logic after #48116 is fixed.
+ //
// Note that this code looks a little wonky, it's currently here to
// hopefully help debug #48116, but otherwise isn't intended to
// cause any problems.
names_to_string(names),
import_directive_subclass_to_string(subclass),
);
- assert!(!names.is_empty());
- assert!(!x.starts_with("::"));
+ if names.is_empty() || x.starts_with("::") {
+ span_bug!(
+ span,
+ "invalid name `{}` at {:?}; global = {}, names = {:?}, subclass = {:?}",
+ x,
+ span,
+ global,
+ names,
+ subclass
+ );
+ }
return x
}
}
fn run_cfail_test(&self) {
let proc_res = self.compile_test();
self.check_if_test_should_compile(&proc_res);
+ self.check_no_compiler_crash(&proc_res);
let output_to_check = self.get_output(&proc_res);
let expected_errors = errors::load_errors(&self.testpaths.file, self.revision);
self.check_error_patterns(&output_to_check, &proc_res);
}
- self.check_no_compiler_crash(&proc_res);
self.check_forbid_output(&output_to_check, &proc_res);
}