-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#[bench] attribute is stable and test crate can be replaced #38998
Comments
As I said in that comment, I found zero evidence that anyone else used benchmarks this way or even knew it was possible. None of rustc-test’s reverse dependencies use As to exposing test API’s, that’s only API of the |
Hmm, ive been using this to get bench on stable for a bit now (but I dont have crates pushed to crates.io). It would be annoying for sure if this broke given that benching is useful, but I want to work on stable |
Since my previous comment, std made a breaking change to the unstable private data structures that |
|
I think this should be reopened, or something... https://doc.rust-lang.org/cargo/commands/cargo-bench.html documents the #[bench] attribute - I quote
No mention of stability is made there. Either the docs should not specify using |
@rbtcollins Posted an update to the docs here: rust-lang/cargo#8227 |
Document that bench is unstable in the man page. This copies the unstable notice from https://doc.rust-lang.org/cargo/reference/cargo-targets.html#benchmarks. cc rust-lang/rust#38998 (comment)
Thanks! |
Per @SimonSapin's comment. It is possible to swap out the test crate via cargo and get the
#[bench]
functionality on stable.This has been abused in the wild for a long time, and is a fairly major blunder. Swapping out the test crate exposes a large swath of ad-hoc test API's to the stable ecosystem (rustc generates calls to these APIs).
Fixing this will require providing a plausible alternative and a long deprecation and migration period.
The text was updated successfully, but these errors were encountered: