-
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
Tracking issue for crates that are compiler dependencies #27812
Comments
Why do we need the stability attributes there anyway? librustc is as much a part of the stable API as the symbol names (which can be accessed via |
This shouldn't compile on stable Rust: extern crate rustc;
fn main() {} Currently we use stability attributes to achieve this goal. I think it's a bit of a stretch to say we've stabilized librustc because we've shipped a binary for it, so I don't consider the fact that you can |
What about using |
For future travelers: if you mistakenly
The fix is to add |
Dear past @tcr3dr , Thanks from the future! |
So I've been thinking about this issue, because it blocks a PR of mine. @eddyb suggested a -Z flag. This does sound good, except we'd want this mechanism perma-unstable and we don't even fully enforce stability of compiler flags yet. So how about this: Add However, I have no idea how easy or hard it would be to implement this. |
I meant to look into it, and unless something else comes up, I'll try tomorrow. |
Using Is there any work-around for this? What's blocking stabilization of |
that's closer to #29553, really. This one is related.
You're trying to inhibit optimizations somewhere?
https://crates.io/crates/bencher would be, except it's missing the one thing you need.
My perspective, though I'm not on the appropriate team so don't take this as gospel. Nobody has put in the needed work to get it to stable; that is, it's largely considered an internals-only thing, and hasn't been evaluated properly for stabilization. |
Yes, specifically in |
I believe there's a point in removing this from the old book published on the website, as the second one is mentioned as "under construction", and you always end up in the first one over here: https://doc.rust-lang.org/1.12.1/book/benchmark-tests.html Can be quite distracting for beginners. |
use of unstable library feature 'test' . I am getting this issue when I am trying to use it for benchmarking. Any workaround for this? |
@ishaniGupta27 |
Could we please make Edit: also, this annoying thing happens when you try to use it:
|
Why is the 0.1 version number significant? It only means that the crate hasn’t changed much since it was extracted from the standard library. Regarding the warning, we should probably replace the trait in that crate with a pair of free functions. |
Remove derives `Encodable`/`Decodable` and unstabilize attribute `#[bench]` `Encodable` and `Decodable` were deprecated before 1.0 and emitted an unsuppressable warning all this time. `#[bench]` is a part of the custom test framework feature and cannot be used meaningfully on stable, only as `cfg(false)`. Crater results can be found in rust-lang#62507 (comment) and below. This PR also reroutes the tracking issue for `feature(test)` from rust-lang#27812 (compiler internals) to rust-lang#50297 (custom test frameworks). Closes rust-lang#62048
Remove derives `Encodable`/`Decodable` and unstabilize attribute `#[bench]` `Encodable` and `Decodable` were deprecated before 1.0 and emitted an unsuppressable warning all this time. `#[bench]` is a part of the custom test framework feature and cannot be used meaningfully on stable, only as `cfg(false)`. Crater results can be found in #62507 (comment) and below. This PR also reroutes the tracking issue for `feature(test)` from #27812 (compiler internals) to #50297 (custom test frameworks). Closes #62048
A lot of people probably end up here because the compiler points you here when you see the |
`benches/bench.rs` uses lazy_static but Cargo.toml does not declare a dependency on it. This causes rustc to use its own internal private copy instead. Sometimes this causes unintuitive errors like Debian bug [942243](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=942243). The underlying issue is rust-lang/rust#27812 but it can be avoided by explicitly declaring the dependency, which you are supposed to do anyways.
`benches/bench.rs` uses lazy_static but Cargo.toml does not declare a dependency on it. This causes rustc to use its own internal private copy instead. Sometimes this causes unintuitive errors like Debian bug [942243](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=942243). The underlying issue is rust-lang/rust#27812 but it can be avoided by explicitly declaring the dependency, which you are supposed to do anyways.
For anyone here because of copying the example |
As of latest stable (1.40), we no longer ship the rustc-dev component by default, and as of #67469, the same is true for nightly. We could now plausibly stop shipping the rustc-dev component onto stable and beta, which would effectively make all compiler-internal crates unstable (and unavailable by default). However, I expect we'll still want to keep the rustc_private feature around as ungating the compiler libraries would make it a bit too easy to use them accidentally if you happen to have the rustc-dev component installed. At the very least though hopefully from now on users won't be confused by the "unstable library feature rustc_private" message on stable anymore! On 1.40, this is the error you get:
whereas previously you got:
|
Does this mean suppressing optimizations used for benchmarking will stop working? |
I think your comment has nothing to do with this issue? The unstable |
Ah, OK, I was confused. Thanks for clarifying! |
This is occuring again, I am getting the following error , using either M1 Mac
The deps in question depend on what is built first but ran into
|
This is a tracking issue for the unstable
rustc_private
feature of the standard distribution. It's pretty unfortunate that we have to explicitly prevent everyone from linking to compiler internals via stability attributes, it'd be better if we just didn't ship them at all perhaps.Is there a better solution? Must we rely on instability forever?
The text was updated successfully, but these errors were encountered: