retep998 / winapi-rs

Rust bindings to Windows API
https://crates.io/crates/winapi
Apache License 2.0
1.85k stars 392 forks source link

Use unions to represent unions #557

Open Invisible-Rabbit-Hunter opened 6 years ago

Invisible-Rabbit-Hunter commented 6 years ago

As rust has unions since 1.19, shouldn't the API use them, instead of structs?

retep998 commented 6 years ago

winapi 0.3 supports Rust 1.6 and therefore is unable to use the newer union language feature. winapi 0.4 will upgrade the minimum Rust version and take advantage of new language features such as that.

MSxDOS commented 6 years ago

winapi 0.4 will upgrade the minimum Rust version and take advantage of new language features such as that.

Can't wait, but that's not happening any time soon, am I right? It will take awhile for even untagged unions to reach stable Rust.

Eh2406 commented 6 years ago

They are stable in 1.19

MSxDOS commented 6 years ago

Hmm, I mistook it for unions with non-Copy field then which currently require #![feature(untagged_unions)]

retep998 commented 6 years ago

Everything in winapi is Copy so that's not a blocker.

benpye commented 5 years ago

@retep998 Is there a timeline for 0.4 as unions have been in for some time now, nearly 2 years...

MSxDOS commented 5 years ago

There are\were other blockers for 0.4 like procedural macros and const fn, and if https://github.com/rust-lang/rust/issues/58713 is one of them then we may as well have to wait for another 2 years.