-
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
rewrite ensure_drop_params_and_item_params_correspond
#95309
Conversation
was ignored by highfive r? rust-lang/compiler |
This comment has been minimized.
This comment has been minimized.
I wonder if try works with conflicts in place... @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Largely LGTM, though I'm not familiar enough with dropck to tell if there aren't any hidden potholes we need to be looking out for by making such a change.
r? @nikomatsakis for 2b982e006bf568b70c7aaa04745b3bc5e2de81d5 in that case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.
So I don't like the syntactic comparison for equality that is throughout this code -- I rather prefer the older code, and I would rather express the correctness conditions logically. Certainly in a-mir-formality that is what I expect us to do. (Something like: for all instances of the struct, the drop impl conditions are met.)
That said, the code is cleaner this way, and the only case I could come up with where using syntactic checks would be a problem seems to already be rejected. I consider that a bug, but it's pre-existing and more of a problem with the other drop code.
struct Foo<T>
where
T: Iterator,
T::Item: Send,
{
t: T,
}
impl<T, I> Drop for Foo<T>
where
T: Iterator<Item = I>,
I: Send,
{
fn drop(&mut self) { }
}
fn main() { }
Do we have a test like this one? If not, can we add one? Otherwise, r=me.
@lcnr and I discussed and we will move this test to another PR, r=me as is |
@bors r=nikomatsakis |
📌 Commit 4a82bc9 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (512a328): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
actually relating types here seems like it's overkill