minus-square0v0@sopuli.xyztoRust@programming.dev•Inline const expressions have been stabilisedlinkfedilinkarrow-up10·5 months agofn foo(x: i32) { match x { const { 3.pow(3) } => println!("three cubed"), _ => {} } } But it looks like inline_const_pat is still unstable, only inline_const in expression position is now stabilized. linkfedilink
minus-square0v0@sopuli.xyztoRust@programming.dev•Inline const expressions have been stabilisedlinkfedilinkarrow-up10·5 months agoIt’s because it has to work in pattern contexts as well, which are not expressions. linkfedilink
minus-square0v0@sopuli.xyztoC++@programming.dev•What is a valid use case for std::any?linkfedilinkarrow-up7·5 months agohttps://devblogs.microsoft.com/cppblog/stdany-how-when-and-why/ linkfedilink
fn foo(x: i32) { match x { const { 3.pow(3) } => println!("three cubed"), _ => {} } }
But it looks like
inline_const_pat
is still unstable, onlyinline_const
in expression position is now stabilized.