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