vecの件 >extern {fn foo(p: &std::vec::Vec<i32>);} >foo(&vec![16, 9]); これだと >warning: `extern` block uses type `std::vec::Vec<i32>` which is not FFI-safe: this struct has unspecified layout >・・・ > = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct と言われ正常に動作しない。クラッシュはしないが実行結果がおかしい >extern {fn foo(p: *const i32);} >foo(vec![16 as i32, 9 as i32].as_ptr()); これなら問題ないようだ。奥が深い