Skip to content

hlist_pat can trigger #[warn(non_shorthand_field_patterns)] #107

@ExpHP

Description

@ExpHP
let hlist_pat![head, ...tail] = list;
warning: the `head:` in this pattern is redundant
  --> src/main.rs:5:18
   |
5  |     => { HCons { head: $a, tail: $b }};
   |                  ^^^^ help: remove this
...
10 |     let hlist_pat!(head, tail) = list;
   |         ---------------------- in this macro invocation
   |
   = note: #[warn(non_shorthand_field_patterns)] on by default

warning: the `tail:` in this pattern is redundant
  --> src/main.rs:5:28
   |
5  |     => { HCons { head: $a, tail: $b }};
   |                            ^^^^ help: remove this
...
10 |     let hlist_pat!(head, tail) = list;
   |         ---------------------- in this macro invocation

    Finished dev [unoptimized + debuginfo] target(s) in 0.50 secs
     Running `target/debug/playground`

I don't see any solution so I opened this thread as a call for help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions