-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Deprecate core::arch::{x86,x86_64}::__{read,write}eflags #51810
Comments
cc @rkruppe @stevecheckoway - also related to #51691 |
cc @rust-lang/libs |
The motivation and deprecation seem fine to me. I don't know the procedural details and exactly what we're allowed to do though. |
I have no opinion on these functions. The process is that we cannot remove stable APIs once they reach the stable channel, which those did 5 days ago. Editions do not help here since only one We can add |
What we can technically do is to change resolution to ignore functions/structs/etc that are present in the metadata of some given crate if those functions wish to not be present on that edition. That wish being expressed by some language feature like idk strawman syntax A slightly more relaxed approach is to add a lint or a hard error that points out that while the function exists, you are not allowed to use it any more. A warn by default lint wouldn't be much of an advantage over the status quo, use of deprecated functions already now emits a lint :p. I think that having edition specific functions is a bad idea for a different reason: it would preclude automated edition updates of codebases, at least as long as those codebases are using one of those functions that are not available in the new edition. |
To add to that: such automated updates are one of the features that editions guarantee. I guess you have a trade off now between the ability to do automated updates flawlessly and the ability to remove deprecated APIs. |
I really don't see any point in forbidding usage of some path in only some editions (not only for this case, but in general). Being hidden + warning on use is sufficient to make most people migrate away from it, and those who aren't deterred by it will likely just work around removal in an edition anyway. It also doesn't allow us to remove the code supporting the feature. |
Deprecation seems fine and sufficient to me. |
So if the libs team signs on the deprecation + I've basically just used |
This is waiting on an update to stdsimd. |
@Mark-Simulacrum no, my PR #51695 updated stdsimd to a suiting version. You only need to close this issue now. |
Hm, I guess my grep failed then. Thanks! |
Compiler-generated code can use the eflags register in between
__{read,write}eflags
calls, making these two intrinsics impossible to use correctly for the cases in which the user reads-modifies-writes to the eflags registers.Even read only operations like performing an alu operation in Rust, and then checking sf or zf by calling these intrinsics are not guaranteed to work either.
The only reliable way to perform these operations is using a single assembly block (e.g. via inline assembly).
This is further discussed in rust-lang/stdarch#485
This issue proposes to deprecate these intrinsics and mark them with
#[doc(hidden)]
, so that we can potentially remove them, maybe in the Rust 2018 edition.EDIT: There is a PR implementing the deprecation here that would need review before being merged: rust-lang/stdarch#494
cc @BurntSushi
The text was updated successfully, but these errors were encountered: