The headline features in 1.33 are:
-
const fn
improvements - Pinning
- Import as
_
- More
const
methods on numeric types - Library stabilizations
See the blog post and detailed release notes.
The headline features in 1.33 are:
const fn
improvements_
const
methods on numeric typesSee the blog post and detailed release notes.
Rust 1.33
I've tried 1.33 with no breakages, but with:
warning: use of deprecated item 'std::error::Error::cause': replaced by Error::source, which can support downcasting
which seems to apply to error-chain. My Cargo.toml specifies error-chain 0.12, although I notice that Cargo.lock has both 0.12.0 and 0.9.0.
What are "irrefutable destructuring patterns"?
const fn foo((x, y): (u8, u8)) { ... })
It's referring to the argument pattern, (x, y): (u8, u8)
. That's a tuple argument being unpacked into its two parts, locally named x
and y
. This has worked in regular functions for a long time, but I guess you couldn't do this in const
functions before.
I think the "irrefutable" word is confusing me ^^' (not native English speaker)
Ah, "irrefutable" means that the pattern will always match. Compare this to refutable match
patterns, like matching a particular enum variant which might not succeed.
There's more info in a relevant section of TRPL: Refutability: Whether a Pattern Might Fail to Match - The Rust Programming Language
Thanks! Makes more sense now
This sounds great! Compile time evaluated functions are great! Especially with annoying constants and stuff.
On a side note, is there any news on when the !
never type will be stabilized?
congras!!!
Now is it possible to write a tree with Pin instead of layers of containers?
Relevant quote from TWiR quote of the week