Skip to content
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

Merged
merged 5 commits into from
May 20, 2022

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Mar 25, 2022

actually relating types here seems like it's overkill

@lcnr
Copy link
Contributor Author

lcnr commented Mar 28, 2022

was ignored by highfive

r? rust-lang/compiler

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 29, 2022
@rust-log-analyzer

This comment has been minimized.

@nagisa
Copy link
Member

nagisa commented Apr 3, 2022

I wonder if try works with conflicts in place...

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 3, 2022
Copy link
Member

@nagisa nagisa left a 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.

compiler/rustc_middle/src/ty/util.rs Outdated Show resolved Hide resolved
compiler/rustc_middle/src/ty/util.rs Outdated Show resolved Hide resolved
@lcnr lcnr force-pushed the dropck-cleanup branch from 40a235e to af8c2a2 Compare April 4, 2022 08:57
@lcnr
Copy link
Contributor Author

lcnr commented Apr 4, 2022

r? @nikomatsakis for 2b982e006bf568b70c7aaa04745b3bc5e2de81d5 in that case

@rust-highfive rust-highfive assigned nikomatsakis and unassigned nagisa Apr 4, 2022
Copy link
Contributor

@nikomatsakis nikomatsakis left a 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.

@nikomatsakis
Copy link
Contributor

@lcnr and I discussed and we will move this test to another PR, r=me as is

@lcnr lcnr force-pushed the dropck-cleanup branch from af8c2a2 to 4a82bc9 Compare May 20, 2022 09:50
@lcnr
Copy link
Contributor Author

lcnr commented May 20, 2022

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented May 20, 2022

📌 Commit 4a82bc9 has been approved by nikomatsakis

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 20, 2022
@bors
Copy link
Contributor

bors commented May 20, 2022

⌛ Testing commit 4a82bc9 with merge 512a328...

@bors
Copy link
Contributor

bors commented May 20, 2022

☀️ Test successful - checks-actions
Approved by: nikomatsakis
Pushing 512a328 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 20, 2022
@bors bors merged commit 512a328 into rust-lang:master May 20, 2022
@rustbot rustbot added this to the 1.63.0 milestone May 20, 2022
@lcnr lcnr deleted the dropck-cleanup branch May 20, 2022 14:08
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (512a328): comparison url.

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: mixed results
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 1 2 1 1 2
mean2 5.7% 2.0% -5.2% -3.6% 0.3%
max 5.7% 2.4% -5.2% -3.6% 5.7%

Cycles

Results
  • Primary benchmarks: 🎉 relevant improvements found
  • Secondary benchmarks: mixed results
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 0 1 2 1 2
mean2 N/A 4.0% -2.0% -4.6% -2.0%
max N/A 4.0% -2.3% -4.6% -2.3%

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. number of relevant changes 2

  2. the arithmetic mean of the percent change 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-perf Status: Waiting on a perf run to be completed. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants