-
Notifications
You must be signed in to change notification settings - Fork 13k
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: fetch_nand #13226
Comments
Triage: i don't have android to test. |
Triage: same as in 2015. |
I unfortunately do not have an android either, and after spending multiple hours trying to get an emulator setup I have decided to not try any more... the code below I believe is the test for this problem today. If someone has a working android version, and can test it, that would be great. #![feature(core_intrinsics)]
use std::sync::atomic::{AtomicUsize, AtomicIsize};
use std::sync::atomic::Ordering::*;
use std::intrinsics::atomic_nand;
#[test]
fn uint_nand() {
let mut x = AtomicUsize::new(0xf731);
unsafe {
assert_eq!(atomic_nand(x.get_mut() as *mut usize, 0x137f), 0xf731);
}
assert_eq!(x.load(SeqCst), !(0xf731 & 0x137f));
}
#[test]
fn int_nand() {
let mut x = AtomicIsize::new(0xf731);
unsafe {
assert_eq!(atomic_nand(x.get_mut() as *mut isize, 0x137f), 0xf731);
}
assert_eq!(x.load(SeqCst), !(0xf731 & 0x137f));
} |
I've run it on android phone (
|
@alexcrichton looks like we may be able to enable these on Android. |
Hurray! |
cc rust-lang#13226 (the tracking issue)
…richton Add fetch_nand to atomics I think this is all fine but I have little familiarity with the atomic code (or libcore in general) so I may have accidentally done something wrong here... cc rust-lang#13226 (the tracking issue)
It looks like the only issue (incorrect behavior on Android) has been resolved. @rfcbot fcp merge |
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period is now complete. |
stabilize fetch_nand This closes #13226 and makes `Atomic*.fetch_nand` stable.
Currently, rust-analyzer highlights the entire region when a `cfg` is inactive (e.g. `#[cfg(windows)]` on a Linux machine). However, unlinked files only highlight the first three characters of the file. This was introduced in rust-lang#8444, but users have repeatedly found themselves with no rust-analyzer support for a file and unsure why (see e.g. rust-lang#13226 and the intentionally prominent pop-up added in PR rust-lang#14366). (Anecdotally, we see this issue bite our users regularly, particularly people new to Rust.) Instead, highlight the entire inactive file, but mark it as all as unused. This allows users to hover and run the quickfix from any line. Whilst this is marginally more prominent, it's less invasive than a pop-up, and users do want to know why they're getting no rust-analyzer support in certain files.
…eykril fix: Highlight unlinked files consistently with inactive files Currently, rust-analyzer highlights the entire region when a `cfg` is inactive (e.g. `#[cfg(windows)]` on a Linux machine). However, unlinked files only highlight the first three characters of the file. This was introduced in rust-lang#8444, but users have repeatedly found themselves with no rust-analyzer support for a file and unsure why (see e.g. rust-lang#13226 and the intentionally prominent pop-up added in PR rust-lang#14366). (Anecdotally, we see this issue bite our users regularly, particularly people new to Rust.) Instead, highlight the entire inactive file, but mark it as all as unused. This allows users to hover and run the quickfix from any line. Whilst this is marginally more prominent, it's less invasive than a pop-up, and users do want to know why they're getting no rust-analyzer support in certain files. Before (note the subtle grey underline is only at the beginning of the first line): ![Screenshot 2024-06-05 at 5 41 17 PM](https://github.com/rust-lang/rust-analyzer/assets/70800/96f5d778-612e-4838-876d-35d9647fe2aa) After (user can hover and fix from any line): ![Screenshot 2024-06-05 at 5 42 13 PM](https://github.com/rust-lang/rust-analyzer/assets/70800/6af90b79-018c-42b9-b3c5-f497de2ccbff)
Tracking issue for
fetch_nand
on integer atomics (it's stable forbool
).On android, it appears that these functions give the wrong answer. See #12964 (comment) for some analysis, and the relevant logs are:
The text was updated successfully, but these errors were encountered: