Rust 配列 (一定サイズのもの、[T, ..Size]) に関する質問です。私は次の作業をしようとしています:
#[deriving(PartialEq)]
struct Test {
dats : [f32, ..16]
}
導出を使用して独自の PartialEq を単純に記述できないことはわかっていますが、それはかなり不快です... 表示されるエラー メッセージもわかりにくいものです (以下を参照)。これを行うための適切な素朴な方法はありますか?
rustc ar.rs
ar.rs:4:3: 4:20 error: mismatched types: expected `&&[f32]` but found `&[f32, .. 16]` (expected &-ptr but found vector)
ar.rs:4 dat : [f32, ..16]
^~~~~~~~~~~~~~~~~
note: in expansion of #[deriving]
ar.rs:2:1: 3:7 note: expansion site
ar.rs:4:3: 4:20 error: mismatched types: expected `&&[f32]` but found `&[f32, .. 16]` (expected &-ptr but found vector)
ar.rs:4 dat : [f32, ..16]
^~~~~~~~~~~~~~~~~
note: in expansion of #[deriving]
ar.rs:2:1: 3:7 note: expansion site
error: aborting due to 2 previous error
今日からラストナイトリービルドです。
ありがとう!