gpt4 book ai didi

rust - 无法找到不安全的特征实现

转载 作者:行者123 更新时间:2023-11-29 08:33:33 28 4
gpt4 key购买 nike

我想使用 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 告诉我特征 VertexMember 不满足?

最佳答案

问题是 cargo 使用的 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" }

关于rust - 无法找到不安全的特征实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38606608/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com