此问题已在此处有答案:
"use of unstable library feature 'collections'" using nightly(3个答案)
3天前关闭。
当尝试使用cargo benchmark功能时,它抛出错误:
error: use of unstable library feature 'test': `bench` is a part of custom test frameworks which are unstable
|
| #[bench]
| ^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #64266 <https://github.com/rust-lang/rust/issues/64266>
= note: `#[deny(soft_unstable)]` on by default
1条答案
按热度按时间bz4sfanl1#
解决此问题的步骤:
1.使用nightly版本编译或将nightly设置为默认值:
要使用夜间版本编译:
要将夜间设置为默认值,请执行以下操作:
1.添加测试功能
为此,在根文件的顶部添加两行。(甚至高于进口)
这将允许您使用
#[bench]
功能。