Skip to content

#[deriving(...)] doesn't work for fixed-size vectors #6883

Closed
@pkgw

Description

@pkgw

Or something along those lines? I'm not quite sure what the correct terminology would be. When I try to compile this:

#[crate_type = "bin"];
extern mod std;

#[deriving(Clone)]
pub struct Hash {
    value: [u8, ..20],
}

fn main () {}

I get:

sample.rs:4:11: 4:16 error: mismatched types: expected `[u8, .. 20]` but found `&[u8, .. 20]` (expected vector but found &-ptr)
sample.rs:4 #[deriving(Clone)]
                       ^~~~~
error: aborting due to previous error

It seems like this should work straightforwardly. The same kind of issue pops up for Cmp, Eq, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions