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

make compare_const_impl a query and use it in instance.rs #98496

Merged
merged 5 commits into from
Oct 6, 2022

Conversation

BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Jun 25, 2022

Fixes #88365

the bug in #88365 was caused by some instance.rs code using the PartialEq impl on Ty to check that the type of the associated const in an impl is the same as the type of the associated const in the trait definition. This was wrong for two reasons:

  • the check typeck does is that the impl type is a subtype of the trait definition's type (see mismatched_impl_ty_2.rs which was ICEing before this PR on stable)
  • it assumes that if two types are equal then the PartialEq impl will reflect that which isnt true for higher ranked types or type level constants when feature(generic_const_exprs) is enabled (see mismatched_impl_ty_3.rs for higher ranked types which was ICEing on stable)

r? @lcnr

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 25, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 25, 2022
@lcnr
Copy link
Contributor

lcnr commented Jun 25, 2022

@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 Jun 25, 2022
@bors
Copy link
Contributor

bors commented Jun 25, 2022

⌛ Trying commit e616802befd6814f6a9c41d87f271e61aaf53da5 with merge f99589b0312bfdb02699eab496c80e3446034f1a...

@lcnr lcnr added I-types-nominated Nominated for discussion during a types team meeting. T-types Relevant to the types team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 25, 2022
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jun 25, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 25, 2022
@rust-log-analyzer

This comment has been minimized.

@lcnr lcnr removed the I-types-nominated Nominated for discussion during a types team meeting. label Jun 28, 2022
@bors
Copy link
Contributor

bors commented Jul 5, 2022

☔ The latest upstream changes (presumably #98584) made this pull request unmergeable. Please resolve the merge conflicts.

@BoxyUwU BoxyUwU force-pushed the instancers_bad_equality branch from 04f88ab to 831f440 Compare September 30, 2022 16:57
@rustbot rustbot added the A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) label Sep 30, 2022
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Sep 30, 2022

Seems like none of the repro's for this PR ice anymore on master... I am not sure what PR changed this but I can only assume it was by accident since error: erroneous constant encountered with no other explanation is Not really any kind of error message at all. This PR now only gives good errors instead of fixing ICEs 😅

@BoxyUwU
Copy link
Member Author

BoxyUwU commented Oct 1, 2022

@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 Oct 1, 2022
@bors
Copy link
Contributor

bors commented Oct 1, 2022

⌛ Trying commit 611db1d with merge 7b04892a1d61b0d2c6f2826177df092d7ae02bca...

@bors
Copy link
Contributor

bors commented Oct 1, 2022

☀️ Try build successful - checks-actions
Build commit: 7b04892a1d61b0d2c6f2826177df092d7ae02bca (7b04892a1d61b0d2c6f2826177df092d7ae02bca)

@rust-timer
Copy link
Collaborator

Queued 7b04892a1d61b0d2c6f2826177df092d7ae02bca with parent 56a35bc, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7b04892a1d61b0d2c6f2826177df092d7ae02bca): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

Instruction count

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

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-2.8%, -2.6%] 2
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 2, 2022
@BoxyUwU BoxyUwU removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 2, 2022
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nits, then r=me

compiler/rustc_hir_analysis/src/check/check.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_analysis/src/check/compare_method.rs Outdated Show resolved Hide resolved
@lcnr
Copy link
Contributor

lcnr commented Oct 6, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Oct 6, 2022

📌 Commit 25ed5d5 has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 6, 2022
@lcnr
Copy link
Contributor

lcnr commented Oct 6, 2022

@bors rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 6, 2022
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#98496 (make `compare_const_impl` a query and use it in `instance.rs`)
 - rust-lang#102680 (Fix overconstrained Send impls in btree internals)
 - rust-lang#102718 (Fix `opaque_hidden_inferred_bound` lint ICE)
 - rust-lang#102725 (Remove `-Ztime`)
 - rust-lang#102736 (Migrate search input color to CSS variable)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit dd0fa6f into rust-lang:master Oct 6, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler panic when indexing associated, constant array of generic length in test
8 participants