You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Obviously Rc, which is supposed to be the replacement for '@' doesn't work because you'd need another pointer inside it anyway.
Rc<~Trait> is a substitute that should work for many instances of shared ownership trait-objects. (Except for the extra indirection, and some size_of details, this will behave almost exactly like Rc<Trait>.)
In any case, this is something that will hopefully come out of the "dynamically sized types" proposals (or similar; #6308) and/or the smart pointer work (probably both).
(Also, if you really need it, @ and @Trait objects still exist, you can add #[feature(managed_boxes)]; at the top of your crate file (NB. the semicolon is required)... If anyone asks, I didn't tell you this. ;) )
[`no_effect`]: Suggest adding `return` if applicable
Closesrust-lang#10941
Unfortunately doesn't catch anything complex as `no_effect` already wouldn't, but I'm fine with that (it catches `ControlFlow` at least :D)
changelog: [`no_effect`]: Suggest adding `return` if statement has same type as function's return type and is the last statement in a block
There was one feature of the @-pointer that has not been fixed since it was removed.
If you wanted to pass a struct around by referring to it as a trait, you could do
@SomeTrait
.~-ptrs aren't always suitable for this because you may need more than one reference to the struct underneath the trait.
&-ptrs aren't suitable for this... well, because they aren't. :P
Obviously Rc, which is supposed to be the replacement for '@' doesn't work because you'd need another pointer inside it anyway.
Is there some way that this functionality can be restored?
The text was updated successfully, but these errors were encountered: