Skip to content

Commit e1d86a4

Browse files
committed
Add coverage mark for struct init shorthand test
1 parent e4757f9 commit e1d86a4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crates/ide_diagnostics/src/handlers/missing_fields.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ fn fixes(ctx: &DiagnosticsContext<'_>, d: &hir::MissingFields) -> Option<Vec<Ass
6464
let missing_fields = ctx.sema.record_literal_missing_fields(&field_list_parent);
6565
for (f, ty) in missing_fields.iter() {
6666
let field_expr = if let Some(local_candidate) = locals.get(&f.name(ctx.sema.db)) {
67+
cov_mark::hit!(field_shorthand);
6768
let candidate_ty = local_candidate.ty(ctx.sema.db);
6869
if ty.could_unify_with(ctx.sema.db, &candidate_ty) {
6970
None
@@ -344,6 +345,7 @@ fn f() {
344345

345346
#[test]
346347
fn test_fill_struct_fields_shorthand() {
348+
cov_mark::check!(field_shorthand);
347349
check_fix(
348350
r#"
349351
struct S { a: &'static str, b: i32 }

0 commit comments

Comments
 (0)