-
Notifications
You must be signed in to change notification settings - Fork 13.3k
run-pass/extern-pass-empty is probably a bogus thing to test #53859
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
…est seems bogus. that is, I suspect it should be retired because it is testing behavior (namely a `#[repr(C)] struct Empty;`) that, if I understand correctly, is undefined. See also rust-lang#53859.
…est seems bogus. that is, I suspect it should be retired because it is testing behavior (namely a `#[repr(C)] struct Empty;`) that, if I understand correctly, is undefined. See also rust-lang#53859.
If I understand correctly from the history of the test, #12762 explicitly added support for empty structs ... by ignoring them ... (?) I'm not 100% sure what our policy should be here. |
nominating for discussion at compiler team meeting. (Though it might need to be discussed more broadly than that.) |
unsafe code guidelines group actually discussed this very topic, see here: rust-lang/unsafe-code-guidelines#31 (comment) |
@pnkfelix ultimately I think we decided that our current behavior makes sense and effectively documented it here in this section; it matches the extensions provided by gcc and other C compilers (though it does not match the C++ behavior). So it does seem like a good thing to test to me. |
This does not imply that our particular test is well setup. |
Discussed during the compiler meeting. It seems that we cannot really make a decision here before UCG becomes an official document. |
The following code hits the lint that warns about trying to put
#[repr(C)]
on an empty struct.rust/src/test/run-pass/extern-pass-empty.rs
Lines 33 to 34 in c2afca3
(This seems like a bogus test that was caught by working on fixing #53764.)
The text was updated successfully, but these errors were encountered: