You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
foo.rs:10:1: 23:2 error: the name `test` conflicts with an external crate that has been imported into this module [E0260]
foo.rs:10 mod test {
foo.rs:11 use super::*;
foo.rs:12 use test::Bencher;
foo.rs:13
foo.rs:14 #[test]
foo.rs:15 fn it_works() {
...
error: aborting due to previous error
The text was updated successfully, but these errors were encountered:
jooert
added a commit
to jooert/rust
that referenced
this issue
Apr 29, 2015
Since rust-lang#24783, the style guidelines recommend that unit tests should live in a submodule `tests` rather than `test` to not clash with the possible use of libtest. This is especially important for benchmark tests as they require libtest. Fixesrust-lang#24923.
Oh, i forgot to change this part of the docs in #24783, where it was decided to have unit tests in a submodule tests rather than test because of exactly the same problem you're describing here. PR is #24931.
Since rust-lang#24783, the style guidelines recommend that unit tests should live in a submodule `tests` rather than `test` to not clash with the possible use of libtest. This is especially important for benchmark tests as they require libtest. Fixesrust-lang#24923.
The benchmark example here does not compile: https://doc.rust-lang.org/book/benchmark-tests.html
Error message when running
rustc foo.rs --test
:The text was updated successfully, but these errors were encountered: