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

expose-ids: pass the correct field for global ID #3669

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

mockersf
Copy link
Contributor

@mockersf mockersf commented Apr 12, 2023

Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections

introduced in #3657

Description

Compiling with feature expose-ids is failing:

   Compiling wgpu v0.15.0 (/wgpu/wgpu)
error[E0308]: mismatched types
    --> /wgpu/wgpu/src/backend/web.rs:61:13
     |
56   |         Self::new(
     |         --------- arguments to this function are incorrect
...
61   |             identified.1,
     |             ^^^^^^^^^^^^ expected struct `NonZeroU64`, found struct `PhantomData`
     |
     = note: expected struct `NonZeroU64`
                found struct `PhantomData<T>`
note: associated function defined here
    --> /wgpu/wgpu/src/context.rs:1013:12
     |
1013 |     pub fn new(id: NonZeroU64, #[cfg(feature = "expose-ids")] global_id: NonZeroU64) -> Self {
     |            ^^^                 ----------------------------------------------------

error[E0308]: mismatched types
    --> /wgpu/wgpu/src/backend/web.rs:74:13
     |
69   |         Self::new(
     |         --------- arguments to this function are incorrect
...
74   |             id.1,
     |             ^^^^ expected struct `NonZeroU64`, found struct `PhantomData`
     |
     = note: expected struct `NonZeroU64`
                found struct `PhantomData<T>`
note: associated function defined here
    --> /wgpu/wgpu/src/context.rs:1013:12
     |
1013 |     pub fn new(id: NonZeroU64, #[cfg(feature = "expose-ids")] global_id: NonZeroU64) -> Self {
     |            ^^^                 ----------------------------------------------------

The global ID is on field 0 of Identified, not 1

Testing
Explain how this change is tested.

@cwfitzgerald cwfitzgerald merged commit d781bb7 into gfx-rs:trunk Apr 12, 2023
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

Successfully merging this pull request may close these issues.

2 participants