Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning at use site for #[repr(C)] type that contains non-#[repr(C)] types #16719

Closed
huonw opened this issue Aug 24, 2014 · 3 comments
Closed
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.

Comments

@huonw
Copy link
Member

huonw commented Aug 24, 2014

#![allow(dead_code)]

struct Foo;
#[repr(C)]
struct Bar { x: Foo }

extern { fn whatever(x: Bar); }

fn main() {}
<anon>:7:25: 7:28 warning: found type without foreign-function-safe
                                             representation annotation in foreign module, consider adding a #[repr(...)] attribute to the type, #[warn(ctypes)] on by default
<anon>:7 extern { fn whatever(x: Bar); }
                                 ^~~

This could either be a warning on Bar, that Foo isn't FFI safe; or not a warning at all. (Or, at the very least, a note pointing to the x field, to help diagnose the problem.)

@huonw huonw added the A-lint label Aug 24, 2014
@o11c
Copy link

o11c commented Aug 24, 2014

Significantly, this occurs even if the struct contains only a pointer-to-non-repr-C-struct

@frewsxcv
Copy link
Member

Triage comment: the warning has not changed

playpen link

@steveklabnik
Copy link
Member

Since new lints have a big impact on users of rustc, the policy is that they should go through the RFC process like other user-facing changes. As such, I'm going to give this one a close, but if anyone comes across this ticket and wants this lint, consider adding it to clippy and/or writing up an RFC. Thanks!

matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this issue Mar 10, 2024
fix: Add basic support for Native Debug

Native Debug doesn't work very well and passing command-line arguments is nasty (rust-lang/rust-analyzer#9815), but I guess it's a start.

Closes rust-lang#9815
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.
Projects
None yet
Development

No branches or pull requests

4 participants