[英]How can I silence `rustc`'s note about which native artifacts to link against?
I've got a project where Rust source files are being automatically generated and compiled into static libraries. 我有一个项目,其中Rust源文件被自动生成并编译到静态库中。 I'd like the output of
rustc
to be streamed to stdout and stderr as usual, but I wish that the following note wasn't always emitted: 我希望将
rustc
输出像往常一样流式传输到stdout和stderr,但我希望并非总是发出以下注释:
note: link against the following native artifacts when linking against this static library
note: the order and any duplication can be significant on some platforms, and so may need to be preserved
note: library: System
note: library: resolv
note: library: c
note: library: m
Is there any way to silence this without silencing too much else? 有什么办法可以在不使其他内容沉默太多的情况下将其静音? The note was useful to me when I was figuring out how to link things automatically, but it won't be useful to my users who never actually see the linking process.
当我想出如何自动链接内容时,该注释对我很有用,但对于从未真正看到链接过程的用户而言,它将无用。
In Rust 1.21 and earlier, there is no way to turn off the output. 在Rust 1.21和更早的版本中,无法关闭输出。
In Rust 1.22, the --print=native-static-libs
option was added. 在Rust 1.22中,添加了
--print=native-static-libs
选项。 When it is not present, it outputs: 如果不存在,则输出:
note: This list will not be printed by default.
注意:默认情况下不会打印此列表。 Please add --print native-static-libs if you need this information.
如果需要此信息,请添加--print native-static-libs。
Adding the option will silence the warning. 添加该选项将使警告静音。
To silence this information without silencing anything else, upgrade to Rust 1.23 once it's released. 要使此信息静音而不使其他任何内容静默,请在Rust 1.23发布后将其升级。
https://github.com/rust-lang/rust/pull/43067 https://github.com/rust-lang/rust/pull/43067
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.