internal: test diagnostic severeties and presense of fixes

This commit is contained in:
Aleksey Kladov 2021-06-14 22:06:28 +03:00
parent 58712088ac
commit 4cfc767d7f
16 changed files with 155 additions and 140 deletions

View file

@ -19,7 +19,7 @@ use crate::{fix, Diagnostic, DiagnosticsContext};
// let a = A { a: 10 };
// ```
pub(crate) fn missing_fields(ctx: &DiagnosticsContext<'_>, d: &hir::MissingFields) -> Diagnostic {
let mut message = String::from("Missing structure fields:\n");
let mut message = String::from("missing structure fields:\n");
for field in &d.missed_fields {
format_to!(message, "- {}\n", field);
}
@ -85,7 +85,7 @@ mod tests {
struct S { foo: i32, bar: () }
fn baz(s: S) {
let S { foo: _ } = s;
//^ Missing structure fields:
//^ error: missing structure fields:
//| - bar
}
"#,