Skip to content

SATS derive(Deserialize) fails for empty enums #325

@gefjon

Description

@gefjon
#[derive(Deserialize)]
enum Empty {}

Fails with an error like:

error[E0283]: type annotations needed
   --> crates/sdk/tests/connect_disconnect_client/src/module_bindings/mod.rs:28:21
    |
28  | #[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
    |                     ^^^^^^^^^^^ cannot infer type
    |
    = note: cannot satisfy `_: AsRef<str>`
note: required by a bound in `<dyn ValidNames>::extend`
   --> /home/phoebe/clockworklabs/SpacetimeDB/crates/sats/src/de.rs:406:18
    |
404 |     pub fn extend<I: IntoIterator>(&mut self, iter: I)
    |            ------ required by a bound in this associated function
405 |     where
406 |         I::Item: AsRef<str>,
    |                  ^^^^^^^^^^ required by this bound in `<dyn ValidNames>::extend`
    = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0283`.
error: could not compile `connect_disconnect_client` (bin "connect_disconnect_client") due to previous error

This makes it impossible to compile autogenerated module_bindings for a module which defines no reducers.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions