Merge pull request #19063 from davidbarsky/davidbarsky/backout-struct-default-fields

internal: backout `hir-*` changes from #19001
This commit is contained in:
David Barsky 2025-01-28 16:45:45 +00:00 committed by GitHub
commit bc10a44798
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 78 additions and 625 deletions

View file

@ -846,35 +846,4 @@ pub struct Claims {
"#,
);
}
#[test]
fn default_field_values() {
check_diagnostics(
r#"
struct F {
field1: i32 = 4,
field2: bool,
}
fn f() {
let _f = F {
field2: true,
..
};
let _f = F {
//^ 💡 error: missing structure fields:
//| - field1
field2: true,
};
let _f = F {
//^ 💡 error: missing structure fields:
//| - field2
..
};
}
"#,
);
}
}

View file

@ -1232,21 +1232,6 @@ fn f() {
let (_, _, _, ..) = (true, 42);
// ^^^^^^^^^^^^^ error: expected (bool, i32), found (bool, i32, {unknown})
}
"#,
);
}
#[test]
fn diagnostics_inside_field_default_expr() {
check_diagnostics(
r#"
struct Foo {
foo: i32 = {
let x = false;
x
// ^ error: expected i32, found bool
},
}
"#,
);
}