1
Fork 0

Migrate some rustc_borrowck diagnostics to SessionDiagnostic

This commit is contained in:
Michael Goulet 2022-06-22 21:43:01 -07:00
parent 8308806403
commit 98af1bfecc
20 changed files with 122 additions and 43 deletions

View file

@ -281,9 +281,19 @@ pub trait Emitter {
let message = bundle.get_message(&identifier).expect("missing diagnostic in fluent bundle");
let value = match attr {
Some(attr) => {
message.get_attribute(attr).expect("missing attribute in fluent message").value()
if let Some(attr) = message.get_attribute(attr) {
attr.value()
} else {
panic!("missing attribute `{attr}` in fluent message `{identifier}`")
}
}
None => {
if let Some(value) = message.value() {
value
} else {
panic!("missing value in fluent message `{identifier}`")
}
}
None => message.value().expect("missing value in fluent message"),
};
let mut err = vec![];