Skip to content

@[derive(...)] on an enum generates nothing (no clone/debug_str), unlike the §11.8 example #1289

Closed

Description

@ehartford

Found rewriting `examples/nebula` under #1150 ruling 4 (`schema.w`'s `Status`).

§11.8 shows `@[derive(Eq, Debug)] enum Role { Admin | Member | Guest }`. On an enum the attribute is accepted and silently produces no impl:

```
@[derive(Debug, Clone)]
enum S { A | B(str) | C(code: i32) }
fn main:
let s = S.B("x")
let t = s.clone()
print("ok")
```

```
error: unknown method 'clone' for type 'S'
```

and a struct deriving `Clone`/`Debug` with an `S` field fails with `unknown method 'debug_str' for type 'S'` / `unknown method 'clone' for type 'S'`. Expected: the derive generates the impls for enums (payload variants included, each payload type meeting the trait's requirement). An accepted-but-inert attribute is a silent fallback. Installed `with v0.15.2.1-g478b26481`; also on the `exdefects` stage1 (#1284).

Workaround in the example: no derives on `Status`/`Telemetry` until fixed.

Activity

  1. added a commit that references this issue on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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