-
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
Compiler lets escape borrowed pointer to local variable. #8229
Comments
As far as I understand type checker considers None to be static variable. But looks like in generated code None is on the stack.
|
So, the borrow checker considers |
Thinking more about it, there is also this special treatment of static constants that was needed for move checking (they can be moved, which seems surprising). But this treatment makes more sense if |
(cc #1679, which is somewhat related) |
Still a bug. This is pretty nasty, and I'm pretty sure it's a soundness hole. Nominating. |
accepted for first major release, P-backcompat-lang |
No longer reproduces with master for me |
Flagging as needstest. |
There is https://github.com/mozilla/rust/blob/master/src/test/compile-fail/regions-lifetime-of-struct-or-enum-variant.rs which looks ok. Should a test with the code from issue description be added? |
Those look sufficient to me! thanks |
cover trait for `trait_duplication_in_bounds` closes rust-lang#8229 changelog: [`trait_duplication_in_bounds`] covers trait functions with `Self` bounds
Following code can be successfully compiled using rust-0.7 and from master.
The text was updated successfully, but these errors were encountered: