One thing that does confuse me in twitter.com/mcclure111/sta:
`fn addone(x:i32) -> i32 { x + 1 }` is "obviously" a const function but Rust does not allow me to treat it as such unless I decorate it const. Is there a linter that will catch "you forgot to const this fn"? Can "Clippy"?
Replying to
Quote Tweet
ME: Ugh I found another error in the spec, it says you can use ANY const expression for the length of an array type but clearly that can't be right, every language has stricter constraints on expressions in that position
ME: *tests it*
*it compiles*
ME: … … … nice
Show this thread
read image description
ALT
read image description
ALT
4
4


