-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
I don't think I'm a good reviewer for this. Re-rolling the dice: r? rust-lang/compiler |
@bors r+ |
📌 Commit 1d43b4d has been approved by |
⌛ 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] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
💥 Test timed out |
This comment has been minimized.
This comment has been minimized.
@bors r+ |
📌 Commit e947fad has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (362010d): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
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.