-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Wrong error message with managed boxes #5717
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
Comments
While we're at it, could someone explain whether "box mutability" is a property of the handle (named variable) or the box? Because:
|
Owned types inherit their mutability from the handle (owner), but managed boxes aren't owned so the mutability is determined by the box's type (
|
Clear, thanks. So it's a property of both the handle and the box. Can I be really annoying and ask how to specify that in the type? I.e.
appears to be a mutable handle to an immutable box, but how do I specify a type with a mutable managed box (without assinging it a value)? |
You can use |
Reproduced. I presume this would be obviated by moving GC into a library (as it would make it more clear that @ and @mut are separate types). |
The error message now accurately states
which is correct because |
Don't lint `while_let_loop` when significant drop order would change fixes rust-lang#7226 fixes rust-lang#7913 fixes rust-lang#5717 For rust-lang#5717 it may not stay fully fixed. This is only completely fixed right now due to all the allowed drop impls have `#[may_dangle]` on their drop impls. This may get changed in the future based on how significant drops are determined, but the example listed with `RefCell` shouldn't break. changelog: Don't lint `while_let_loop` when the order of significant drops would change
The compiler reports the wrong error message in this sample (which I don't know whether should be errornous or not; I'm just learning Rust):
The message reported is:
I'm using the compiler from commit 5f13e9c.
The text was updated successfully, but these errors were encountered: