Skip to content

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

Merged
bors merged 4 commits into
rust-lang:masterfrom
oli-obk:unconstrained_opaque_type
Sep 20, 2022
Merged

Allow patterns to constrain the hidden type of opaque types#99806
bors merged 4 commits into
rust-lang:masterfrom
oli-obk:unconstrained_opaque_type

Conversation

@oli-obk

@oli-obkoli-obk commented Jul 27, 2022

Copy link
Copy Markdown
Contributor

fixes#96572

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

TODO:

@rustbotrustbot 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
Copy Markdown
Contributor

r? @jackh726

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 27, 2022
@oli-obkoli-obk mentioned this pull request Jul 28, 2022
@oli-obk

Copy link
Copy Markdown
ContributorAuthor

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion.

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

@rustbotrustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 28, 2022
@bors

bors commented Jul 28, 2022

Copy link
Copy Markdown
Collaborator

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

@bors

bors commented Jul 28, 2022

Copy link
Copy Markdown
Collaborator

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

@rust-timer

Copy link
Copy Markdown
Collaborator

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

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (3f31457bb3c0282484d0c1277e64f571afa882cd): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regressions found
mean1maxcount2
Regressions 😿
(primary)
0.7%2.9%171
Regressions 😿
(secondary)
0.9%5.8%138
Improvements 🎉
(primary)
N/AN/A0
Improvements 🎉
(secondary)
N/AN/A0
All 😿🎉 (primary)0.7%2.9%171

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 😿 relevant regressions found
mean1maxcount2
Regressions 😿
(primary)
N/AN/A0
Regressions 😿
(secondary)
2.6%3.1%3
Improvements 🎉
(primary)
N/AN/A0
Improvements 🎉
(secondary)
N/AN/A0
All 😿🎉 (primary)N/AN/A0

Cycles

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: no relevant changes found
mean1maxcount2
Regressions 😿
(primary)
2.2%2.5%2
Regressions 😿
(secondary)
N/AN/A0
Improvements 🎉
(primary)
-2.3%-2.3%1
Improvements 🎉
(secondary)
N/AN/A0
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 change23

  2. number of relevant changes23

@rustbotrustbot 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

bors commented Jul 31, 2022

Copy link
Copy Markdown
Collaborator

☔ 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.
@jackh726jackh726 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-obkforce-pushed the unconstrained_opaque_type branch from fad4617 to 95dc7f8CompareAugust 31, 2022 11:33
@oli-obk

Copy link
Copy Markdown
ContributorAuthor

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion.

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

@rustbotrustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 31, 2022
@bors

bors commented Aug 31, 2022

Copy link
Copy Markdown
Collaborator

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

@bors

bors commented Aug 31, 2022

Copy link
Copy Markdown
Collaborator

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

@rust-timer

Copy link
Copy Markdown
Collaborator

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

@rust-timer

Copy link
Copy Markdown
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.

mean1rangecount2
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.

mean1rangecount2
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.

mean1rangecount2
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 change23

  2. number of relevant changes23

@rustbotrustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 31, 2022
@estebank

Copy link
Copy Markdown
Contributor

@bors r+ rollup=never

@bors

bors commented Sep 19, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit dab1074 has been approved by estebank

It is now in the queue for this repository.

@borsbors 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
Copy Markdown
ContributorAuthor

@bors r=estebank

@bors

bors commented Sep 19, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 1905f8c has been approved by estebank

It is now in the queue for this repository.

@bors

bors commented Sep 20, 2022

Copy link
Copy Markdown
Collaborator

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

@rust-log-analyzer

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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

@bors

bors commented Sep 20, 2022

Copy link
Copy Markdown
Collaborator

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

@bors

bors commented Sep 20, 2022

Copy link
Copy Markdown
Collaborator

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

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Sep 20, 2022
@bors
bors merged commit 4136b59 into rust-lang:masterSep 20, 2022
@rustbotrustbot added this to the 1.66.0 milestone Sep 20, 2022
@rust-timer

Copy link
Copy Markdown
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.

mean1rangecount2
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.

mean1rangecount2
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 change2

  2. number of relevant changes2

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
fixesrust-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
fixesrust-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.
fixesrust-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.
fixesrust-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.
fixesrust-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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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

@oli-obk@rust-highfive@rust-timer@bors@rust-log-analyzer@rustbot@estebank@jackh726