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

safe_packed_borrows warning on wingdi::BITMAPFILEHEADER #629

Closed
Arnavion opened this issue Jun 12, 2018 · 2 comments
Closed

safe_packed_borrows warning on wingdi::BITMAPFILEHEADER #629

Arnavion opened this issue Jun 12, 2018 · 2 comments

Comments

@Arnavion
Copy link
Contributor

warning: #[derive] can't be used on a #[repr(packed)] struct that does not derive Copy (error E0133)
   --> src\macros.rs:354:54
    |
354 |           STRUCT!{#[cfg_attr(feature = "debug", derive(Debug))] $($rest)*}
    |                                                        ^^^^^
    |
   ::: src\um\wingdi.rs:599:1
    |
599 | / STRUCT!{ #[debug] #[repr(packed)] struct BITMAPFILEHEADER {
600 | |     bfType: WORD,
601 | |     bfSize: DWORD,
602 | |     bfReserved1: WORD,
603 | |     bfReserved2: WORD,
604 | |     bfOffBits: DWORD,
605 | | }}
    | |__- in this macro invocation
    |
    = note: #[warn(safe_packed_borrows)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043>
@retep998
Copy link
Owner

This is a known issue in Rust rust-lang/rust#50826

@Arnavion
Copy link
Contributor Author

Yeah, it happens if there's an explicit impl. If you #[derive(Copy)] it goes away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants