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

Fortify handing of where bounds on trait & trait alias definitions #96715

Merged
merged 4 commits into from
May 10, 2022

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented May 4, 2022

Closes #96664
Closes #96665

Since #93803, when listing all bounds and predicates we now need to account for the possible presence of predicates on any of the generic parameters. Both bugs were hidden by the special handling of bounds at the generic parameter declaration position.

Trait alias expansion used to confuse predicates on Self and where predicates.
Exiting too late when listing all the bounds caused a cycle error.

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

r? @michaelwoerister

(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 May 4, 2022
@michaelwoerister
Copy link
Member

I don't think I'm a good reviewer for this. Re-rolling the dice: r? rust-lang/compiler

@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented May 9, 2022

📌 Commit 1d43b4d has been approved by compiler-errors

@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 May 9, 2022
@bors
Copy link
Contributor

bors commented May 9, 2022

⌛ Testing commit 1d43b4d with merge 19d72cf1e1ec94a4173edab7a315796d56d0c4c3...

@@ -7,6 +7,6 @@ trait Alias<T> = where T: Trait;

impl<T> WithType for T {
type Ctx = dyn Alias<T>;
//~^ ERROR the size for values of type `(dyn Trait + 'static)` cannot be known at compilation time
//~^ ERROR at least one trait is required for an object type [E0224]
Copy link
Contributor

Choose a reason for hiding this comment

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

@compiler-errors Is this not a diagnostics regression?

Copy link
Member

Choose a reason for hiding this comment

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

why would this be a diagnostics regression? i thought the previous error message was nonsense, since trait alias "Alias" has no trait types...

Copy link
Member

Choose a reason for hiding this comment

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

perhaps this is a question for @cjgillot and not me, though?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you're right, this isn't a regression. The new error message is somewhat confusing though.

@bors
Copy link
Contributor

bors commented May 9, 2022

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 9, 2022
@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented May 9, 2022

📌 Commit e947fad has been approved by compiler-errors

@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 May 9, 2022
@bors
Copy link
Contributor

bors commented May 10, 2022

⌛ Testing commit e947fad with merge 362010d...

@bors
Copy link
Contributor

bors commented May 10, 2022

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing 362010d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 10, 2022
@bors bors merged commit 362010d into rust-lang:master May 10, 2022
@rustbot rustbot added this to the 1.62.0 milestone May 10, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (362010d): comparison url.

Summary:

  • Primary benchmarks: 🎉 relevant improvements found
  • Secondary benchmarks: no relevant changes found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 0 0 2 0 2
mean2 N/A N/A -0.3% N/A -0.3%
max N/A N/A -0.4% N/A -0.4%

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. the arithmetic mean of the percent change

@cjgillot cjgillot deleted the trait-alias-loop branch May 11, 2022 20:42
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
9 participants