-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Update fingerprint tests macros #46523
Update fingerprint tests macros #46523
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @michaelwoerister (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Between these and the previous updates I contributed, I gained decent deduction skills as to which artifacts (HirBody/MirValidated/etc) should change in response to certain code changes. This indicates to me that tagging mentor issues is working 👍 I did encounter one issue which confused my intuition and sparked a bit of curiosity. // while_let_loops.rs
#[cfg(cfail1)]
pub fn change_continue_label() {
let mut _x = 0;
'outer: while true {
'inner: while true {
_x = 1;
continue 'inner;
}
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_label() {
let mut _x = 0;
'outer: while true {
'inner: while true {
_x = 1;
continue 'outer;
}
}
}
// while_let_loops.rs
#[cfg(cfail1)]
pub fn change_continue_label() {
let mut _x = 0;
'outer: while let Some(0u32) = None {
'inner: while let Some(0u32) = None {
_x = 1;
continue 'inner;
}
}
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_label() {
let mut _x = 0;
'outer: while let Some(0u32) = None {
'inner: while let Some(0u32) = None {
_x = 1;
continue 'outer;
}
}
} In the "while loop" case, only HirBody and MirValidated are dirty. It is a little strange that only MirValidated is dirty and not MirOptimized, but I assume this is because optimization gives identical results regardless of label. But if this is the case for "while loops", why is it not for "while let loops"? Instead, "while let loops" give a dirty MirOptimized as well as TypeckTables. This may not be important, but since it was the only bit of code which gave me unintuitive results I thought I should bring it up. |
Wow, thanks a lot, @CrockAgile! I'll review as soon as I find the time.
That's curious indeed. However looking at the MIR on play.rust-lang.org, both versions are the same for the vanilla |
Looks good to me. Thanks, @CrockAgile! @bors r+ |
📌 Commit 3f0cc7c has been approved by |
@bors p=1 |
…michaelwoerister Update fingerprint tests macros Part of #44924 r? @michaelwoerister
☀️ Test successful - status-appveyor, status-travis |
Part of #44924
r? @michaelwoerister