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

fails to build for 64-bit Windows with rust 1.69 #1

Closed
jeremyd2019 opened this issue May 28, 2023 · 2 comments
Closed

fails to build for 64-bit Windows with rust 1.69 #1

jeremyd2019 opened this issue May 28, 2023 · 2 comments

Comments

@jeremyd2019
Copy link

jeremyd2019 commented May 28, 2023

Due to MSxDOS/ntapi#15:

  error[E0793]: reference to packed field is unaligned
      --> C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\ntapi-0.3.6\src\ntexapi.rs:2785:52
       |
  2785 |         *tick_count.QuadPart_mut() = read_volatile(&(*USER_SHARED_DATA).u.TickCountQuad);
       |                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
       = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
  
  error[E0793]: reference to packed field is unaligned
      --> C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\ntapi-0.3.6\src\ntexapi.rs:2809:25
       |
  2809 |         ((read_volatile(&(*USER_SHARED_DATA).u.TickCountQuad)
       |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
       = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
  
  For more information about this error, try `rustc --explain E0793`.
  error: could not compile `ntapi` due to 2 previous errors

Maybe it just needs to update the Cargo.lock?

@podsvirov
Copy link
Owner

Thanks for the report! I will update dependencies in my spare time (hopefully soon).

@podsvirov
Copy link
Owner

Fixed in faf15a2.

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