bytecodealliance / bytecodealliance/wit-bindgen
Rust: Creating a large tuple results in error, as large tuples do not implement fmt::Debug
- Dominant language
- Rust
- Stars
- 1.5k
- Forks
- 286
- Avg merge
- 6h 32m
- Merged PRs (30d)
- 19
Description
When using a tuple as a fixed length array (in my case for the purposes of storing a UUID in a 16-byte buffer) results in the following error:
```
error[E0277]: `(u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8)` doesn't implement `Debug`
--> src/bindings.rs:69:39
|
69 | .field("key", &self.key)
| ^^^^^^^^^ `(u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8)` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
= help: the trait `Debug` is not implemented for `(u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8)`
= help: the following other types implement trait `Debug`:
()
(A, Z, Y, X, W, V, U, T)
(B, A, Z, Y, X, W, V, U, T)
(C, B, A, Z, Y, X, W, V, U, T)
(D, C, B, A, Z, Y, X, W, V, U, T)
(E, D, C, B, A, Z, Y, X, W, V, U, T)
(T,)
(U, T)
and 5 others
= note: required for the cast from `&(u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8)` to `&dyn Debug
````
This could be fixed by implementing https://github.com/WebAssembly/component-model/pull/384 and using `list` which could be stored in rust as `[u8;16]`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.