|
| 1 | +Version 1.33.0 (2019-02-28) |
| 2 | +========================== |
| 3 | + |
| 4 | +Language |
| 5 | +-------- |
| 6 | +- [You can now use the `cfg(target_vendor)` attribute.][57465] E.g. |
| 7 | + `#[cfg(target_vendor="linux")] fn main() { println!("Hello Linux!"); }` |
| 8 | +- [You can now have multiple patterns in `if let` and `while let` |
| 9 | + expressions.][57532] You can do this with the same syntax as a `match` |
| 10 | + expression. E.g. |
| 11 | + ```rust |
| 12 | + enum Creature { |
| 13 | + Crab(String), |
| 14 | + Person(String), |
| 15 | + } |
| 16 | + |
| 17 | + fn main() { |
| 18 | + let state = Creature::Crab("Ferrous"); |
| 19 | + |
| 20 | + if let Creature::Crab(name) | Creature::Person(name) { |
| 21 | + println!("This creature's name is: {}", name); |
| 22 | + } |
| 23 | + } |
| 24 | + ``` |
| 25 | +- [You can now have irrefutable `if let` and `while let` patterns.][57535] Using |
| 26 | + this feature will by default produce a warning as this behaviour can be |
| 27 | + unintuitive. E.g. `if let _ = 5 {}` |
| 28 | +- [You can now use `let` bindings and pattern destructurcting in |
| 29 | + constant functions.][57175] |
| 30 | +- [You can now specify multiple attributes in a `cfg_attr` attribute.][57332] |
| 31 | + E.g. `#[cfg_attr(all(), must_use, optimize)]` |
| 32 | +- [You can now specify a specific alignment with the `#[repr(packed)]` |
| 33 | + attribute.][57049] E.g. `#[repr(packed(2))] struct Foo(i16, i32);` is a struct |
| 34 | + with an alignment of 2 bytes and a size of 6 bytes. |
| 35 | +- [You can now call unsafe constant functions.][57067] E.g. |
| 36 | + ```rust |
| 37 | + unsafe const fn foo() -> i32 { 5 } |
| 38 | + const fn bar() -> i32 { |
| 39 | + unsafe { foo() } |
| 40 | + } |
| 41 | + ``` |
| 42 | +- [You can now import an item from a module as a `_`.][56303] This allows you to |
| 43 | + import a trait's impls, and not have the name in the namespace. E.g. |
| 44 | + ```rust |
| 45 | + use std::io::Read as _; |
| 46 | + |
| 47 | + // Allowed as there is only one `Read` in the module. |
| 48 | + pub trait Read {} |
| 49 | + ``` |
| 50 | +- [`extern` functions will now abort by default when panicking.][55982] |
| 51 | + |
| 52 | +Compiler |
| 53 | +-------- |
| 54 | +- [You can now set a linker flavor for `rustc` with the `-Clinker-flavor` |
| 55 | + command line argument.][56351] |
| 56 | +- [The mininum required LLVM version has been bumped to 6.0.][56642] |
| 57 | +- [Added support for the PowerPC64 architecture on FreeBSD.][57615] |
| 58 | +- [The `x86_64-fortanix-unknown-sgx` target support has been upgraded to |
| 59 | + tier 2 support.][57130] Visit the [platform support] page for information on |
| 60 | + Rust's platform support. |
| 61 | +- [Added support for the `thumbv7neon-linux-androideabi` and |
| 62 | + `thumbv7neon-unknown-linux-gnueabihf` targets.][56947] |
| 63 | +- [Added support for the `x86_64-unknown-uefi` target.][56769] |
| 64 | + |
| 65 | +Libraries |
| 66 | +--------- |
| 67 | +- [The functions `overflowing_{add, sub, mul, shl, shr}` are now constant |
| 68 | + functions for all numeric types.][57566] |
| 69 | +- [The `get` method for all `NonZero` types is now constant.][57167] |
| 70 | +- [The functions `count_ones`, `count_zeros`, `leading_zeros`, `trailing_zeros`, |
| 71 | + `swap_bytes`, `from_be`, `from_le`, `to_be`, `to_le` are now constant for all |
| 72 | + numeric types.][57234] |
| 73 | +- [`Ipv4Addr::new` is now a constant function][57234] |
| 74 | + |
| 75 | +Stabilized APIs |
| 76 | +--------------- |
| 77 | +- [`unix::FileExt::read_exact_at`] |
| 78 | +- [`unix::FileExt::write_exact_at`] |
| 79 | +- [`Option::transpose`] |
| 80 | +- [`Result::transpose`] |
| 81 | +- [`convert::identity`] |
| 82 | +- [`pin::Pin`] |
| 83 | +- [`Vec::resize_with`] |
| 84 | +- [`VecDeque::resize_with`] |
| 85 | +- [`Duration::as_millis`] |
| 86 | +- [`Duration::as_micros`] |
| 87 | +- [`Duration::as_nanos`] |
| 88 | + |
| 89 | +Cargo |
| 90 | +----- |
| 91 | +- [Cargo should now rebuild a crate if a file was modified during the initial |
| 92 | + build.][cargo/6484] |
| 93 | + |
| 94 | + |
| 95 | +[57615]: https://github.com/rust-lang/rust/pull/57615/ |
| 96 | +[57465]: https://github.com/rust-lang/rust/pull/57465/ |
| 97 | +[57532]: https://github.com/rust-lang/rust/pull/57532/ |
| 98 | +[57535]: https://github.com/rust-lang/rust/pull/57535/ |
| 99 | +[57566]: https://github.com/rust-lang/rust/pull/57566/ |
| 100 | +[57130]: https://github.com/rust-lang/rust/pull/57130/ |
| 101 | +[57167]: https://github.com/rust-lang/rust/pull/57167/ |
| 102 | +[57175]: https://github.com/rust-lang/rust/pull/57175/ |
| 103 | +[57234]: https://github.com/rust-lang/rust/pull/57234/ |
| 104 | +[57332]: https://github.com/rust-lang/rust/pull/57332/ |
| 105 | +[56947]: https://github.com/rust-lang/rust/pull/56947/ |
| 106 | +[57049]: https://github.com/rust-lang/rust/pull/57049/ |
| 107 | +[57067]: https://github.com/rust-lang/rust/pull/57067/ |
| 108 | +[56769]: https://github.com/rust-lang/rust/pull/56769/ |
| 109 | +[56642]: https://github.com/rust-lang/rust/pull/56642/ |
| 110 | +[56303]: https://github.com/rust-lang/rust/pull/56303/ |
| 111 | +[56351]: https://github.com/rust-lang/rust/pull/56351/ |
| 112 | +[55982]: https://github.com/rust-lang/rust/pull/55982/ |
| 113 | +[cargo/6484]: https://github.com/rust-lang/cargo/pull/6484/ |
| 114 | +[`unix::FileExt::read_exact_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#read_exact_at |
| 115 | +[`unix::FileExt::write_exact_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#write_exact_at |
| 116 | +[`Option::transpose`]: https://doc.rust-lang.org/std/option/enum.Option.html#transpose |
| 117 | +[`Result::transpose`]: https://doc.rust-lang.org/std/result/enum.Result.html#transpose |
| 118 | +[`convert::identity`]: https://doc.rust-lang.org/std/convert/fn.identity.html |
| 119 | +[`pin::Pin`]: https://doc.rust-lang.org/std/pin/struct.Pin.html |
| 120 | +[`Vec::resize_with`]: https://doc.rust-lang.org/std/vec/struct.Vec.html#resize_with |
| 121 | +[`VecDeque::resize_with`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#resize_with |
| 122 | +[`Duration::as_millis`]: https://doc.rust-lang.org/std/time/struct.Duration.html#as_millis |
| 123 | +[`Duration::as_micros`]: https://doc.rust-lang.org/std/time/struct.Duration.html#as_micros |
| 124 | +[`Duration::as_nanos`]: https://doc.rust-lang.org/std/time/struct.Duration.html#as_millis |
| 125 | + |
| 126 | + |
1 | 127 | Version 1.32.0 (2019-01-17)
|
2 | 128 | ==========================
|
3 | 129 |
|
|
0 commit comments