Stream: general

Topic: unsized locals


RalfJ (Feb 07 2019 at 13:30, on Zulip):

= help: the trait std::marker::Sized is not implemented for dyn std::fmt::Display
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature

that message would be more helpful if it told me how that feature gate is called...

RalfJ (Feb 07 2019 at 13:31, on Zulip):

hm, seems to be unsized_locals but that does not help

Jake Goulding (Feb 07 2019 at 20:41, on Zulip):

https://doc.rust-lang.org/nightly/unstable-book/language-features/unsized-locals.html

Jake Goulding (Feb 07 2019 at 20:41, on Zulip):

There's a number of restrictions. I'm guessing you are trying to return such a type

Jake Goulding (Feb 07 2019 at 20:41, on Zulip):

When turned on, you can have unsized arguments and locals

RalfJ (Feb 08 2019 at 08:31, on Zulip):

no, not returning, just unsizing in a local without a Box

RalfJ (Feb 08 2019 at 08:32, on Zulip):

but mostly the error message should really state the feature name, I think

RalfJ (Feb 08 2019 at 08:32, on Zulip):

of course in this case that'd also be confusing because the error remains in place with the feature gate^^

RalfJ (Feb 08 2019 at 08:32, on Zulip):

but it still tells you to enable "a" feature gate

Last update: Nov 20 2019 at 12:20UTC