Announcing Rust 1.33.0

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.


:clap: Rust 1.33 :clap:

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.

1 Like

I think the "irrefutable" word is confusing me ^^' (not native English speaker)

1 Like

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.

1 Like

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

1 Like

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?


Now is it possible to write a tree with Pin instead of layers of containers?

Relevant quote from TWiR quote of the week :stuck_out_tongue: