2016-07-27 29 views
0

我想使用vulkano,它有a new crate中的所有示例。我複製的文件夾examples出來,改變了Cargo.toml到無法找到不安全的性狀實施

[package] 
name = "examples" 
version = "0.1.0" 
build = "build.rs" 

[dependencies] 
vulkano = "0.1.0" 
vulkano-win = "0.1.0" 
cgmath = "0.7.0" 
image = "0.6.1" 
winit = "0.5.1" 

[build-dependencies] 
vk-sys = "0.1.1" 
vulkano-shaders = "0.1.0" 

當我嘗試建立我得到:

error: the trait bound `(f32, f32, f32): vulkano::pipeline::vertex::VertexMember` is not satisfied [E0277] 
) { T :: format () } let dummy = 0usize as * const $ out ; f (
                  ^
note: in this expansion of impl_vertex! (defined in <vulkano macros>) 
help: run `rustc --explain E0277` to see a detailed explanation 
note: required by `<Vertex as vulkano::pipeline::vertex::Vertex>::member::f` 

錯誤位於here和特點是implemented here

爲什麼我得到這個錯誤? Rust爲什麼告訴我這個性狀不滿意?

回答

0

問題是似乎有貨物使用crates.io的版本不匹配。指出.git作品的每一個依賴。

[package] 
name = "examples" 
version = "0.1.0" 
build = "build.rs" 

[dependencies] 
vulkano = { git = "https://github.com/tomaka/vulkano" } 
vulkano-win = { git = "https://github.com/tomaka/vulkano" } 
cgmath = "0.7.0" 
image = "0.6.1" 
winit = "0.5.1" 

[build-dependencies] 
vk-sys = { git = "https://github.com/tomaka/vulkano" } 
vulkano-shaders = { git = "https://github.com/tomaka/vulkano" }