Commit 50be4794 authored by Aaron Power's avatar Aaron Power

Updated for 1.33.0

parent b139669f
Version 1.33.0 (2019-02-28)
- [You can now use the `cfg(target_vendor)` attribute.][57465] E.g.
`#[cfg(target_vendor="linux")] fn main() { println!("Hello Linux!"); }`
- [You can now have multiple patterns in `if let` and `while let`
expressions.][57532] You can do this with the same syntax as a `match`
expression. E.g.
enum Creature {
fn main() {
let state = Creature::Crab("Ferrous");
if let Creature::Crab(name) | Creature::Person(name) {
println!("This creature's name is: {}", name);
- [You can now have irrefutable `if let` and `while let` patterns.][57535] Using
this feature will by default produce a warning as this behaviour can be
unintuitive. E.g. `if let _ = 5 {}`
- [You can now use `let` bindings and pattern destructurcting in
constant functions.][57175]
- [You can now specify multiple attributes in a `cfg_attr` attribute.][57332]
E.g. `#[cfg_attr(all(), must_use, optimize)]`
- [You can now specify a specific alignment with the `#[repr(packed)]`
attribute.][57049] E.g. `#[repr(packed(2))] struct Foo(i16, i32);` is a struct
with an alignment of 2 bytes and a size of 6 bytes.
- [You can now call unsafe constant functions.][57067] E.g.
unsafe const fn foo() -> i32 { 5 }
const fn bar() -> i32 {
unsafe { foo() }
- [You can now import an item from a module as a `_`.][56303] This allows you to
import a trait's impls, and not have the name in the namespace. E.g.
use std::io::Read as _;
// Allowed as there is only one `Read` in the module.
pub trait Read {}
- [`extern` functions will now abort by default when panicking.][55982]
- [You can now set a linker flavor for `rustc` with the `-Clinker-flavor`
command line argument.][56351]
- [The mininum required LLVM version has been bumped to 6.0.][56642]
- [Added support for the PowerPC64 architecture on FreeBSD.][57615]
- [The `x86_64-fortanix-unknown-sgx` target support has been upgraded to
tier 2 support.][57130] Visit the [platform support] page for information on
Rust's platform support.
- [Added support for the `thumbv7neon-linux-androideabi` and
`thumbv7neon-unknown-linux-gnueabihf` targets.][56947]
- [Added support for the `x86_64-unknown-uefi` target.][56769]
- [The functions `overflowing_{add, sub, mul, shl, shr}` are now constant
functions for all numeric types.][57566]
- [The `get` method for all `NonZero` types is now constant.][57167]
- [The functions `count_ones`, `count_zeros`, `leading_zeros`, `trailing_zeros`,
`swap_bytes`, `from_be`, `from_le`, `to_be`, `to_le` are now constant for all
numeric types.][57234]
- [`Ipv4Addr::new` is now a constant function][57234]
Stabilized APIs
- [`unix::FileExt::read_exact_at`]
- [`unix::FileExt::write_exact_at`]
- [`Option::transpose`]
- [`Result::transpose`]
- [`convert::identity`]
- [`pin::Pin`]
- [`Vec::resize_with`]
- [`VecDeque::resize_with`]
- [`Duration::as_millis`]
- [`Duration::as_micros`]
- [`Duration::as_nanos`]
- [Cargo should now rebuild a crate if a file was modified during the initial
Version 1.32.0 (2019-01-17)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment