1
Fork 0

rustc_errors: let DiagnosticBuilder::emit return a "guarantee of emission".

This commit is contained in:
Eduard-Mihai Burtescu 2022-01-27 09:44:25 +00:00
parent 0b9d70cf6d
commit b7e95dee65
83 changed files with 842 additions and 471 deletions

View file

@ -376,9 +376,13 @@ fn get_test_runner(
match &*meta_list {
[single] => match single.meta_item() {
Some(meta_item) if meta_item.is_word() => return Some(meta_item.path.clone()),
_ => sd.struct_span_err(span, "`test_runner` argument must be a path").emit(),
_ => {
sd.struct_span_err(span, "`test_runner` argument must be a path").emit();
}
},
_ => sd.struct_span_err(span, "`#![test_runner(..)]` accepts exactly 1 argument").emit(),
_ => {
sd.struct_span_err(span, "`#![test_runner(..)]` accepts exactly 1 argument").emit();
}
}
None
}