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

Allow patterns to constrain the hidden type of opaque types #99806

Merged
merged 4 commits into from
Sep 20, 2022

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jul 27, 2022

fixes #96572

reverts a revert as original PR was a perf regression that was fixed by reverting it: #99368 (comment))

TODO:

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 27, 2022
@rust-highfive
Copy link
Collaborator

r? @jackh726

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 27, 2022
@oli-obk
Copy link
Contributor Author

oli-obk commented Jul 28, 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 Jul 28, 2022
@bors
Copy link
Contributor

bors commented Jul 28, 2022

⌛ Trying commit 459499fc9b0b46cca8fe035ab6c0c35d046e3065 with merge 3f31457bb3c0282484d0c1277e64f571afa882cd...

@bors
Copy link
Contributor

bors commented Jul 28, 2022

☀️ Try build successful - checks-actions
Build commit: 3f31457bb3c0282484d0c1277e64f571afa882cd (3f31457bb3c0282484d0c1277e64f571afa882cd)

@rust-timer
Copy link
Collaborator

Queued 3f31457bb3c0282484d0c1277e64f571afa882cd with parent 48316df, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3f31457bb3c0282484d0c1277e64f571afa882cd): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regressions found
mean1 max count2
Regressions 😿
(primary)
0.7% 2.9% 171
Regressions 😿
(secondary)
0.9% 5.8% 138
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 0.7% 2.9% 171

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 😿 relevant regressions found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
2.6% 3.1% 3
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) N/A N/A 0

Cycles

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: no relevant changes found
mean1 max count2
Regressions 😿
(primary)
2.2% 2.5% 2
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-2.3% -2.3% 1
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 0.7% 2.5% 3

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

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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 28, 2022
@bors
Copy link
Contributor

bors commented Jul 31, 2022

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

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 4, 2022
…rors

Some `is_useful` cleanups

rust-lang#98582 was reverted because it was a perf regression.

rust-lang#99806 reintroduces the changes, but this PR picks individual ones that have no regressions.
@jackh726 jackh726 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 Aug 7, 2022
@oli-obk oli-obk force-pushed the unconstrained_opaque_type branch from fad4617 to 95dc7f8 Compare August 31, 2022 11:33
@oli-obk
Copy link
Contributor Author

oli-obk commented Aug 31, 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 Aug 31, 2022
@bors
Copy link
Contributor

bors commented Aug 31, 2022

⌛ Trying commit 95dc7f8590787fb1a19e2c43174a522d575dfc78 with merge 6642984ad271a4e8d3ef4b40e65cb81333574b2f...

@bors
Copy link
Contributor

bors commented Aug 31, 2022

☀️ Try build successful - checks-actions
Build commit: 6642984ad271a4e8d3ef4b40e65cb81333574b2f (6642984ad271a4e8d3ef4b40e65cb81333574b2f)

@rust-timer
Copy link
Collaborator

Queued 6642984ad271a4e8d3ef4b40e65cb81333574b2f with parent 12e4fd0, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6642984ad271a4e8d3ef4b40e65cb81333574b2f): comparison URL.

Overall result: ❌ regressions - 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
0.7% [0.2%, 3.2%] 120
Regressions ❌
(secondary)
1.2% [0.2%, 6.2%] 76
Improvements ✅
(primary)
-0.4% [-0.5%, -0.4%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.6% [-0.5%, 3.2%] 123

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)
2.7% [2.1%, 3.4%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.3% [-3.3%, -3.3%] 1
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)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
2.9% [2.4%, 3.4%] 2
Improvements ✅
(primary)
-3.1% [-3.1%, -3.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.4% [-3.1%, 2.3%] 2

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 31, 2022
@rust-highfive rust-highfive assigned estebank and unassigned jackh726 Sep 19, 2022
@estebank
Copy link
Contributor

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Sep 19, 2022

📌 Commit dab1074 has been approved by estebank

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 Sep 19, 2022
@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 19, 2022

@bors r=estebank

@bors
Copy link
Contributor

bors commented Sep 19, 2022

📌 Commit 1905f8c has been approved by estebank

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Sep 20, 2022

⌛ Testing commit 1905f8c with merge 96e76bf486de500ea58ae9ec78dd9c386321aa0a...

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 20, 2022

@bors retry I can't find any failure in the logs, only cancelled builds

@bors
Copy link
Contributor

bors commented Sep 20, 2022

⌛ Testing commit 1905f8c with merge 4136b59...

@bors
Copy link
Contributor

bors commented Sep 20, 2022

☀️ Test successful - checks-actions
Approved by: estebank
Pushing 4136b59 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 20, 2022
@bors bors merged commit 4136b59 into rust-lang:master Sep 20, 2022
@rustbot rustbot added this to the 1.66.0 milestone Sep 20, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4136b59): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -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)
2.9% [2.9%, 2.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.7% [-4.7%, -4.7%] 1
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.5% [2.3%, 2.6%] 2
Improvements ✅
(primary)
-2.7% [-3.2%, -2.2%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.7% [-3.2%, -2.2%] 2

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 6, 2022
…estebank

Allow patterns to constrain the hidden type of opaque types

fixes rust-lang#96572

reverts a revert as original PR was a perf regression that was fixed by reverting it: rust-lang#99368 (comment))

TODO:

* check if rust-lang#99685 is avoided
bjorn3 pushed a commit to bjorn3/rust that referenced this pull request Oct 23, 2022
…estebank

Allow patterns to constrain the hidden type of opaque types

fixes rust-lang#96572

reverts a revert as original PR was a perf regression that was fixed by reverting it: rust-lang#99368 (comment))

TODO:

* check if rust-lang#99685 is avoided
@oli-obk oli-obk deleted the unconstrained_opaque_type branch November 9, 2022 10:14
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 3, 2023
…ction, r=cjgillot

Perform OpaqueCast field projection on HIR, too.

fixes rust-lang#105819

This is necessary for closure captures in 2021 edition, as they capture individual fields, not the full mentioned variables. So it may try to capture a field of an opaque (because the hidden type is known to be something with a field).

See rust-lang#99806 for when and why we added OpaqueCast to MIR.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 3, 2023
…ction, r=cjgillot

Perform OpaqueCast field projection on HIR, too.

fixes rust-lang#105819

This is necessary for closure captures in 2021 edition, as they capture individual fields, not the full mentioned variables. So it may try to capture a field of an opaque (because the hidden type is known to be something with a field).

See rust-lang#99806 for when and why we added OpaqueCast to MIR.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 4, 2023
…ction, r=cjgillot

Perform OpaqueCast field projection on HIR, too.

fixes rust-lang#105819

This is necessary for closure captures in 2021 edition, as they capture individual fields, not the full mentioned variables. So it may try to capture a field of an opaque (because the hidden type is known to be something with a field).

See rust-lang#99806 for when and why we added OpaqueCast to MIR.
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Aug 10, 2023
…cjgillot

Perform OpaqueCast field projection on HIR, too.

fixes #105819

This is necessary for closure captures in 2021 edition, as they capture individual fields, not the full mentioned variables. So it may try to capture a field of an opaque (because the hidden type is known to be something with a field).

See rust-lang/rust#99806 for when and why we added OpaqueCast to MIR.
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 20, 2024
Some `is_useful` cleanups

#98582 was reverted because it was a perf regression.

rust-lang/rust#99806 reintroduces the changes, but this PR picks individual ones that have no regressions.
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
Some `is_useful` cleanups

#98582 was reverted because it was a perf regression.

rust-lang/rust#99806 reintroduces the changes, but this PR picks individual ones that have no regressions.
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. 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.

TAIT: "unconstrained opaque type" error even if it's constrained
8 participants