-
Notifications
You must be signed in to change notification settings - Fork 916
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
Derive Debug for everything. #76
Comments
It does indeed appear to be addressed by #72, which takes a slightly different route (serialize instead of debug). For structures with trivially derived |
The API Guidelines do suggest that every type should implement |
@nuew thank you, that is convincing! |
This adds `#[derive(Debug)]` to all public structs and enums possible. This also required adding it to some private types that they transitively depend on. However, the following types depend on types from external crates that do not implement Debug: * `device::Device` * `hub::Hub` * `swap_chain::Surface` * `swap_chain::SwapChain` To support these types, we would need to use either custom `Debug` impls or something like [Derivative](https://mcarton.github.io/rust-derivative/). This helps improve the situation in gfx-rs#76.
This adds #[derive(Debug)] to all public structs and enums possible. This also required adding it to some private types that they transitively depend on. However, the following types depend on types from external crates that do not implement Debug: * device::Device * hub::Hub * swap_chain::Surface * swap_chain::SwapChain To support these types, we would need to use either custom Debug impls or something like Derivative. This helps improve the situation in gfx-rs#76.
216: Add Naïve Debug Derives Where Possible r=kvark a=arashikou This adds `#[derive(Debug)]` to all public structs and enums possible. This also required adding it to some private types that they transitively depend on. However, the following types depend on types from external crates that do not implement Debug: * `device::Device` * `hub::Hub` * `swap_chain::Surface` * `swap_chain::SwapChain` To support these types, we would need to use either custom `Debug` impls or something like [Derivative](https://mcarton.github.io/rust-derivative/). This helps improve the situation in #76. Co-authored-by: John W. Bruce <arashikou@gmail.com>
216: Add Naïve Debug Derives Where Possible r=kvark a=arashikou This adds `#[derive(Debug)]` to all public structs and enums possible. This also required adding it to some private types that they transitively depend on. However, the following types depend on types from external crates that do not implement Debug: * `device::Device` * `hub::Hub` * `swap_chain::Surface` * `swap_chain::SwapChain` To support these types, we would need to use either custom `Debug` impls or something like [Derivative](https://mcarton.github.io/rust-derivative/). This helps improve the situation in #76. Co-authored-by: John W. Bruce <arashikou@gmail.com>
There were some types that could not derive Debug automatically in gfx-rs#216 because they (or types they transitively contained) contained types from external crates that do not implement Debug. By adding custom Debug impls, we can handle this case. The Debug impls given here do the same thing #[derive(Debug)] would do, except that they skip the fields that do not themselves implement Debug. After this, all public types will implement Debug, as requested in gfx-rs#76.
Most of the public types now |
Great news! It looks like @BourgondAries already did most of this work about a week ago in gfx-rs/gfx@b576335 and gfx-rs/gfx@5e9803d. So many of our types can just derive The backend instances are the sole exceptions. I'll continue tracking through the type chains to see how best to enable them to implement |
@arashikou here we come - gfx-rs/gfx#2817 |
@arashikou could you update to https://crates.io/crates/gfx-hal/0.2.1 and see if adding |
With gfx-hal 0.2.1, all of the gfx-hal types that wgpu depends on implement Debug. Thus, some types that could not derive Debug in gfx-rs#216 can now derive Debug. The sole public type that does not derive Debug at this point is wgpu-native::hub::Hub. It depends on backend types that do not yet implement Debug. Related to gfx-rs#76.
For most types, yes. |
2869: Derive Debug for All Backend Instances r=kvark a=arashikou Fixing gfx-rs/wgpu#76 is blocked on the `Instance` types for all the backends not implementing `Debug`. This patch adds `#[derive(Debug)]` to all the instances. PR checklist: - [ ] `make` succeeds (on *nix) - [ ] `make reftests` succeeds - [x] tested examples with the following backends: dx11, dx12, vulkan - [x] `rustfmt` run on changed code Co-authored-by: John W. Bruce <juce@google.com>
2876: Derive Debug for All Backend Instances r=kvark a=arashikou This is a backport of #2869 to the hal-0.2 branch. There are no changes to Vulkan because its `Instance` already derives `Debug`. None of the OpenGL backend changes found in the master branch version are included because the OpenGL backend does not provide `Instance` on the hal-0.2 branch. I have verified that this branch with this commit can be used in wgpu to enable fixing gfx-rs/wgpu#76. PR checklist: - [x] `make` succeeds (on *nix) - [x] `make reftests` succeeds - [x] tested examples with the following backends: dx11, dx12, vulkan - [x] `rustfmt` run on changed code Co-authored-by: John W. Bruce <juce@google.com>
223: Derive Debug for All Remaining Public Types r=kvark a=arashikou With gfx-hal 0.2.1 and the various backend releases on 2019-06-28, all of the gfx-hal types that wgpu depends on implement `Debug`. Thus, some types that could not derive `Debug` in #216 can now derive `Debug`. This patch also adds `Debug` implementations for a few types that were recently added to wgpu. Fixes #76. Co-authored-by: John W. Bruce <arashikou@gmail.com>
With gfx-hal 0.2.1 and the various backend releases on 2019-06-28, all of the gfx-hal types that wgpu depends on implement Debug. Thus, some types that could not derive Debug in gfx-rs#216 can now derive Debug. This patch also adds Debug implementations for a few types that were recently added to wgpu. Fixes gfx-rs#76.
With gfx-hal 0.2.1, all of the gfx-hal types that wgpu depends on implement Debug. Thus, some types that could not derive Debug in gfx-rs#216 can now derive Debug. The sole public type that does not derive Debug at this point is wgpu-native::hub::Hub. It depends on backend types that do not yet implement Debug. Related to gfx-rs#76.
With gfx-hal 0.2.1 and the various backend releases on 2019-06-28, all of the gfx-hal types that wgpu depends on implement Debug. Thus, some types that could not derive Debug in gfx-rs#216 can now derive Debug. This patch also adds Debug implementations for a few types that were recently added to wgpu. Fixes gfx-rs#76.
223: Derive Debug for All Remaining Public Types r=kvark a=arashikou With gfx-hal 0.2.1 and the various backend releases on 2019-06-28, all of the gfx-hal types that wgpu depends on implement `Debug`. Thus, some types that could not derive `Debug` in #216 can now derive `Debug`. This patch also adds `Debug` implementations for a few types that were recently added to wgpu. Fixes #76. Co-authored-by: John W. Bruce <arashikou@gmail.com>
With gfx-hal 0.2.1 and the various backend releases on 2019-06-28, all of the gfx-hal types that wgpu depends on implement Debug. Thus, some types that could not derive Debug in gfx-rs#216 can now derive Debug. This patch also adds Debug implementations for a few types that were recently added to wgpu. Fixes gfx-rs#76.
Maybe related to #72 - in which close.
I rely a lot on
println
and I want to be able to see the fields of various objects.Like, I want to know which adapter is currently in use and there is no way(?) as of now.
The text was updated successfully, but these errors were encountered: