Rust-for-linux archive mirror
 help / color / mirror / Atom feed
From: Alice Ryhl <aliceryhl@google.com>
To: rust-for-linux <rust-for-linux@vger.kernel.org>
Subject: Bug report: Deriving zeroable doesn't work with const generics
Date: Fri, 3 May 2024 17:03:18 +0200	[thread overview]
Message-ID: <CAH5fLghwYAZkwjEQzhXK1RV6-J8SVBugk-a+OvjEC79evXdJAA@mail.gmail.com> (raw)

Hi list,

I noticed that the #[derive(Zeroable)] macro doesn't work on const
generics. I get this error:

error[E0404]: expected trait, found builtin type `u64`
   --> rust/kernel/list.rs:105:32
    |
105 | pub struct ListLinks<const ID: u64 = 0> {
    |                                ^^^ not a trait

Anyone up for fixing it?

Alice

             reply	other threads:[~2024-05-03 15:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 15:03 Alice Ryhl [this message]
2024-05-04 14:17 ` Bug report: Deriving zeroable doesn't work with const generics Benno Lossin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH5fLghwYAZkwjEQzhXK1RV6-J8SVBugk-a+OvjEC79evXdJAA@mail.gmail.com \
    --to=aliceryhl@google.com \
    --cc=rust-for-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).