-
Notifications
You must be signed in to change notification settings - Fork 13.4k
2018 edition module/path changes don't work for libtest benchmarks #55133
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
This is still existent in 1.32.0-nightly! |
Cc @petrochenkov @rust-lang/compiler |
I believe the intent was that you'd still need to use |
Yes, everything looks as expected. |
"Expected", from the compiler's perspective, with some knowledge of how the https://rust-lang-nursery.github.io/edition-guide/rust-2018/module-system/path-clarity.html
Idiom warnings suggest removing it in all other cases. At the very least, shouldn't this make it into a note in the edition guide? Not a pretty exception to the rule, but I don't think I'm the last user that will not expect this special case. |
Idiom lints are not yet properly supported, and the test crate is unstable. I do think it might be useful to provide a better diagnostic here in the long-run, but for most users I don't expect this to be a big problem for users since we don't automatically remove |
In rust-lang/edition-guide#121, the hint was offered that this discrepancy ( |
The plan for now is to continue using |
@cramertj |
In the project branch with current head of dekellum/body-image@15b9789, I'm attempting to preview the 2018 edition changes and test
cargo fix
. Besides my own education the process has uncovered a few issues in my project where I can actually back-port fixes that are also relevant today with rust 1.27.2. Thanks for the 2018 improvements andcargo fix
!I also found one limitation of the module/path changes that seems worth mentioning hear in case its an oversight, and because I can't find any other issue addressing it. It seems as of the rust nightlies I'm testing I still, oddly, need to use
extern crate test
in the benches/*.Given starting benches/*.rs benchmarks with the following:
As of rustc 1.30.0-nightly (\5c875d938 2018-09-24), this produces a warning like in other places, as expected:
However, as of rustc 1.31.0-nightly (\4699283c5 2018-10-13), the warning goes away?
Next, in both of these nightly releases, if I make the expected modification dropping
extern crate test
anduse test::Bencher
(see the change of dekellum/body-image@15b9789), I get the following error:Note finally that I was able to remove all the other
extern crate
statements for the benches/* dependencies.I suspect the non-stable, nightly-only nature of libtest benchmarks somehow has contributed to this, but many projects include benches/*. Should this be fixed or at least noted as a shortcoming somewhere?
meta
The text was updated successfully, but these errors were encountered: