-
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
ICE: lifetime substitution in struct fields when struct implements Drop #14889
Comments
(If you add |
Due to a rustc bug: rust-lang/rust#13853 rust-lang/rust#14889 this requires the 'unsafe_destructor' attribute on the Transaction class.
Another example: fn main() {
}
struct OnExitSentinel<'a> {
block: ||: 'a,
}
impl<'a> Drop for OnExitSentinel<'a> {
fn drop(&mut self) {
}
} |
Seems fine now. |
Flagging as needstest |
@jakub- @alexcrichton wait, it looks to me like we now require Note that I already said in a preceding comment that adding So what is our end-goal here? If the bug was that I was always supposed to be using |
Right now the end goal for me is to not ICE (which it doesn't today), and I think that requiring |
This is almost certainly a dupe of #13853, suggest closing |
I wrote:
The reason I now understand: Until #8861 is fixed (which I have been working on), we do not have rules in place to prevent an implementation of |
It seems #15585 added a test that covers the case here. Closing. |
Add context to overly long loop message
This is an injection from sometime post 0.8 (probably very recent).
Some code:
A transcript showing the ICE:
The backtrace:
Here is another version of the code that is closer to what originally led me to discover this ICE:
Note: Sometime between 0.8 and 0.10, we started requiring implementors of
Drop
to satisfySend
. So it is possible the latter code is just incorrect under the new rules.The text was updated successfully, but these errors were encountered: