Closed krolli closed 4 years ago
Still something is failing?
From Metal CI:
error[E0594]: cannot assign to `swapchain.acquire_mode`, as `swapchain` is not declared as mutable
--> libportability-gfx/src/impls.rs:4475:13
|
4450 | let (swapchain, backbuffers) = match unsafe {
| --------- help: consider changing this to be mutable: `mut swapchain`
...
4475 | / swapchain.acquire_mode = match value.to_lowercase().as_str() {
4476 | | "wait" => AcquireMode::Wait,
4477 | | "oldest" => AcquireMode::Oldest,
4478 | | other => panic!("unknown acquiring option: {}", other),
4479 | | };
| |_____________^ cannot assign
error: aborting due to previous error
Lesson learned. I'll have to set up Travis for my fork to catch these before making pull requests...
Please squash the commits
I'll have to set up Travis for my fork to catch these before making pull requests...
No need for that. Testing your PR errors here is totally fine, at least as long as it compiles at least on your machine. If we required the contributors to test on all platforms before making a PR, we'd not get too far :)
Fixed and squashed.
Bors r+
On Jan 23, 2020, at 01:30, Martin Krošlák notifications@github.com wrote:
Fixed and squashed.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
This PR fixes warnings encountered with stable 1.40.0 rust toolchain. The most interesting issue is likely switch from
mem::zeroed()
and related functions toMaybeUninit
.While
mem::zeroed()
is not marked deprecated in the same way asmem::uninitialized()
is, compiler still threw warning on it. However, in this case it may have been causing undefined behavior, asEntryPoint
contains references which may not be null. Another option here would be usingOption
instead ofMaybeUninit
, which would be completely safe with some extra checks. Since original code didn't, and because valid Vulkan use requires exactly one vertex shader, I chose to useMaybeUninit
instead.