Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/rust/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Compiler errors 是否有一个rustc相当于-墙-墙?_Compiler Errors_Rust_Compiler Warnings - Fatal编程技术网

Compiler errors 是否有一个rustc相当于-墙-墙?

Compiler errors 是否有一个rustc相当于-墙-墙?,compiler-errors,rust,compiler-warnings,Compiler Errors,Rust,Compiler Warnings,在学习rust的前10分钟,我得到了58个lint选项,我在想:gcc有一个解决方案。要明确的是:我想启用所有警告/lint(-Wall),并将所有警告视为硬错误(-Werror) 将放入.toml文件的内容?解决方法?gcc的-Werror变成rustc-拒绝警告或板条箱属性#![拒绝(警告)]。您还可以通过环境变量传递标志:RUSTFLAGS=“--deny warnings” -Wall或-Weverything在锈迹中并不是真的需要的;它所涵盖的大部分内容都已经是编译错误或默认为拒绝或警

在学习rust的前10分钟,我得到了58个lint选项,我在想:gcc有一个解决方案。要明确的是:我想启用所有警告/lint(
-Wall
),并将所有警告视为硬错误(
-Werror


将放入
.toml
文件的内容?解决方法?

gcc的
-Werror
变成
rustc-拒绝警告
或板条箱属性
#![拒绝(警告)]
。您还可以通过环境变量传递标志:
RUSTFLAGS=“--deny warnings”

-Wall
-Weverything
在锈迹中并不是真的需要的;它所涵盖的大部分内容都已经是编译错误或默认为拒绝或警告的lint。你应该明白,皮棉只是:皮棉。这些问题至少有点主观,而且往往非常主观。默认情况下允许使用的lint应该是,因此它们对于特定用途来说是有用的工具,但是启用很多lint通常是没有意义的。(例如,
box指针
lint:在某种类型的库中,您可能希望能够说“我保证这不会使用堆内存”,但这并不是坏事。)


rustc在其所含的棉绒方面相当保守;要了解更广泛的线头,请查看。

您知道,
-Wall
出于兼容性原因,实际上并不是“所有警告”。我相信,
-Weverything
诚实地说,一切都是警告。