【发布时间】:2016-11-10 00:56:45
【问题描述】:
我第一次尝试运行 clippy(我知道.. 我现在真的应该这样做是吗?)我遇到了一些错误。
我尝试 lint 的项目依赖于 Piston,它编译并成功运行。但是,当我运行clippy as described in the README:
rustup run nightly cargo clippy
它似乎开始尝试构建 Piston 并报告如下错误:
error[E0433]: failed to resolve. Use of undeclared type or module `gfx`
--> /Users/Simon/.cargo/registry/src/github.com- 1ecc6299db9ec823/piston2d-gfx_graphics-0.31.2/src/back_end.rs:31:10
|
31 | pos: gfx::VertexBuffer<PositionFormat>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `gfx`
error[E0433]: failed to resolve. Use of undeclared type or module `gfx`
--> /Users/Simon/.cargo/registry/src/github.com- 1ecc6299db9ec823/piston2d-gfx_graphics-0.31.2/src/back_end.rs:32:12
|
32 | color: gfx::VertexBuffer<ColorFormat>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `gfx`
error[E0433]: failed to resolve. Use of undeclared type or module `gfx`
--> /Users/Simon/.cargo/registry/src/github.com-1ecc6299db9ec823/piston2d-gfx_graphics-0.31.2/src/back_end.rs:33:19
|
33 | blend_target: gfx::BlendTarget<gfx::format::Srgba8>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `gfx`
error[E0433]: failed to resolve. Use of undeclared type or module `gfx`
--> /Users/Simon/.cargo/registry/src/github.com-1ecc6299db9ec823/piston2d-gfx_graphics-0.31.2/src/back_end.rs:33:36
|
33 | blend_target: gfx::BlendTarget<gfx::format::Srgba8>,
| ^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `gfx`
error[E0433]: failed to resolve. Use of undeclared type or module `gfx`
--> /Users/Simon/.cargo/registry/src/github.com-1ecc6299db9ec823/piston2d-gfx_graphics-0.31.2/src/back_end.rs:34:21
|
34 | stencil_target: gfx::StencilTarget<gfx::format::DepthStencil>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `gfx`
我如何告诉 Clippy 不要构建 Piston 和/或 lint 它?我怎样才能让它构建我的项目并检查我的代码?
cargo build 从同一文件夹成功构建项目。
我还没有深入研究 clippy 的代码,但我认为它在 AST 上工作并且实际上并没有构建二进制文件……看来我是不正确的?
【问题讨论】:
-
谢谢@Shepmaster 我不知道 标记。我学到了一些东西!
-
太糟糕了,我无法真正帮助解决真正的问题:-)
标签: rust rust-clippy