Closed
Description
Currently fixed-length arrays (i.e. [f64, .. 3]
) implement no traits, because each size needs to be implemented separately. It'd be nice to be able to parameterise the length.
One consequence is that #[deriving]
doesn't work with them (and gives strange error messages):
#[deriving(Eq)]
struct SuDoku {
map: [[uint, .. 9], .. 9]
}
$ rustc --lib sudoku.rs
sudoku.rs:1:11: 1:14 error: mismatched types: expected `&&[[uint, .. 9]]` but found `&[[uint, .. 9], .. 9]` ([] storage differs: expected & but found 9)
sudoku.rs:1 #[deriving(Eq)]
^~~
sudoku.rs:1:11: 1:14 error: failed to find an implementation of trait core::cmp::Eq for [uint, .. 9]
sudoku.rs:1 #[deriving(Eq)]
^~~