Announcing Rust 1.79.0blog.rust-lang.orgexternal-linkcross-posted to: rust@lemmy.ml snaggen ( @snaggen@programming.dev ) Rust@programming.dev • 5 months ago message-square1fedilinkarrow-up152
arrow-up152external-linkAnnouncing Rust 1.79.0blog.rust-lang.org snaggen ( @snaggen@programming.dev ) Rust@programming.dev • 5 months ago message-square1fedilinkcross-posted to: rust@lemmy.ml
minus-square BatmanAoD ( @BatmanAoD@programming.dev ) linkfedilink7•edit-25 months agoHow does the const { None } example type-inference work? The size of the option type can’t be known without knowing the type of the Somevariant. Edit: aha, it doesn’t work as-is. It needs to infer the type of elements of foo from usage. https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=05a95c592626b6935ae812527aa6bbc6
How does the
const { None }
example type-inference work? The size of the option type can’t be known without knowing the type of theSome
variant.Edit: aha, it doesn’t work as-is. It needs to infer the type of elements of
foo
from usage. https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=05a95c592626b6935ae812527aa6bbc6