-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Enforce well formedness for type alias impl trait's hidden type #95519
Conversation
r? @cjgillot (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@@ -144,7 +144,7 @@ impl<'a, K, V> IntoIterator for &'a VecMap<K, V> { | |||
} | |||
} | |||
|
|||
impl<'a, K, V> IntoIterator for &'a mut VecMap<K, V> { | |||
impl<'a, K: 'a, V: 'a> IntoIterator for &'a mut VecMap<K, V> { |
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.
The reason this is required is that associated type alias impl trait does not imply bounds from the type that the impl is for.
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.
Should we be concerned for breakage and get a lang team signoff?
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.
Nope, this is just a nightly feature. We can add more implicit magic later
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.
yeah, i think this is something we can fix later
I am probably not the right reviewer for type-related stuff. |
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.
loooks good, and it's behind a feature-gate anyways so i'm not worried about the regression in associated TAIT.
@bors r+
@@ -144,7 +144,7 @@ impl<'a, K, V> IntoIterator for &'a VecMap<K, V> { | |||
} | |||
} | |||
|
|||
impl<'a, K, V> IntoIterator for &'a mut VecMap<K, V> { | |||
impl<'a, K: 'a, V: 'a> IntoIterator for &'a mut VecMap<K, V> { |
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.
yeah, i think this is something we can fix later
📌 Commit b30bcfa has been approved by |
⌛ Testing commit b30bcfa with merge b13b9f84bef48e5857378c07094fa59e8986f76c... |
💔 Test failed - checks-actions |
Same failure as referenced in #95775 (comment) ? @bors retry |
⌛ Testing commit b30bcfa with merge 18cc4c9bd0d07bbdcc76a5dbfeb876f6b0e61322... |
💔 Test failed - checks-actions |
The job Click to see the possible cause of the failure (guessed by this bot)
|
edit: this different network error just took 3 hours to be displayed, it's not a new failure... |
☀️ Test successful - checks-actions |
Finished benchmarking commit (f4a7ce9): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
fixes #84657
This was not an issue with return-position-impl-trait because the generic bounds of the function are the same as those of the opaque type, and the hidden type must already be well formed within the function.
With type-alias-impl-trait the hidden type could be defined in a function that has more lifetime bounds than the type alias. This is fine, but the hidden type must still be well formed without those additional bounds.