|
| 1 | +Version 1.40.0 (2019-12-19) |
| 2 | +=========================== |
| 3 | + |
| 4 | +Language |
| 5 | +-------- |
| 6 | +- [You can now use tuple `struct`s and tuple `enum` variant's constructors in |
| 7 | + `const` contexts.][65188] e.g. |
| 8 | + |
| 9 | + ```rust |
| 10 | + pub struct Point(i32, i32); |
| 11 | + |
| 12 | + const ORIGIN: Point = { |
| 13 | + let constructor = Point; |
| 14 | + |
| 15 | + constructor(0, 0) |
| 16 | + }; |
| 17 | + ``` |
| 18 | + |
| 19 | +- [You can now mark `struct`s, `enum`s, and `enum` variants with the `#[non_exhaustive]` attribute to |
| 20 | + indicate that there may be variants or fields added in the future.][64639] |
| 21 | + For example this requires adding a wild-card branch (`_ => {}`) to any match |
| 22 | + statements on a non-exhaustive `enum`. [(RFC 2008)] |
| 23 | +- [You can now use function-like procedural macros in `extern` blocks and in |
| 24 | + type positions.][63931] e.g. `type Generated = macro!();` |
| 25 | +- [Function-like and attribute procedural macros can now emit |
| 26 | + `macro_rules!` items, so you can now have your macros generate macros.][64035] |
| 27 | +- [The `meta` pattern matcher in `macro_rules!` now correctly matches the modern |
| 28 | + attribute syntax.][63674] For example `(#[$m:meta])` now matches `#[attr]`, |
| 29 | + `#[attr{tokens}]`, `#[attr[tokens]]`, and `#[attr(tokens)]`. |
| 30 | + |
| 31 | +Compiler |
| 32 | +-------- |
| 33 | +- [Added tier 3 support\* for the |
| 34 | + `thumbv7neon-unknown-linux-musleabihf` target.][66103] |
| 35 | +- [Added tier 3 support for the |
| 36 | + `aarch64-unknown-none-softfloat` target.][64589] |
| 37 | +- [Added tier 3 support for the `mips64-unknown-linux-muslabi64`, and |
| 38 | + `mips64el-unknown-linux-muslabi64` targets.][65843] |
| 39 | + |
| 40 | +\* Refer to Rust's [platform support page][forge-platform-support] for more |
| 41 | + information on Rust's tiered platform support. |
| 42 | + |
| 43 | +Libraries |
| 44 | +--------- |
| 45 | +- [The `is_power_of_two` method on unsigned numeric types is now a `const` function.][65092] |
| 46 | + |
| 47 | +Stabilized APIs |
| 48 | +--------------- |
| 49 | +- [`BTreeMap::get_key_value`] |
| 50 | +- [`HashMap::get_key_value`] |
| 51 | +- [`Option::as_deref_mut`] |
| 52 | +- [`Option::as_deref`] |
| 53 | +- [`Option::flatten`] |
| 54 | +- [`UdpSocket::peer_addr`] |
| 55 | +- [`f32::to_be_bytes`] |
| 56 | +- [`f32::to_le_bytes`] |
| 57 | +- [`f32::to_ne_bytes`] |
| 58 | +- [`f64::to_be_bytes`] |
| 59 | +- [`f64::to_le_bytes`] |
| 60 | +- [`f64::to_ne_bytes`] |
| 61 | +- [`f32::from_be_bytes`] |
| 62 | +- [`f32::from_le_bytes`] |
| 63 | +- [`f32::from_ne_bytes`] |
| 64 | +- [`f64::from_be_bytes`] |
| 65 | +- [`f64::from_le_bytes`] |
| 66 | +- [`f64::from_ne_bytes`] |
| 67 | +- [`mem::take`] |
| 68 | +- [`slice::repeat`] |
| 69 | +- [`todo!`] |
| 70 | + |
| 71 | +Cargo |
| 72 | +----- |
| 73 | +- [Cargo will now always display warnings, rather than only on |
| 74 | + fresh builds.][cargo/7450] |
| 75 | +- [Feature flags (except `--all-features`) passed to a virtual workspace will |
| 76 | + now produce an error.][cargo/7507] Previously these flags were ignored. |
| 77 | +- [You can now publish `dev-dependencies` without including |
| 78 | + a `version`.][cargo/7333] |
| 79 | + |
| 80 | +Misc |
| 81 | +---- |
| 82 | +- [You can now specify the `#[cfg(doctest)]` attribute to include an item only |
| 83 | + when running documentation tests with `rustdoc`.][63803] |
| 84 | + |
| 85 | +Compatibility Notes |
| 86 | +------------------- |
| 87 | +- [As previously announced, any previous NLL warnings in the 2015 edition are |
| 88 | + now hard errors.][64221] |
| 89 | +- [The `include!` macro will now warn if it failed to include the |
| 90 | + entire file.][64284] The `include!` macro unintentionally only includes the |
| 91 | + first _expression_ in a file, and this can be unintuitive. This will become |
| 92 | + either a hard error in a future release, or the behavior may be fixed to include all expressions as expected. |
| 93 | +- [Using `#[inline]` on function prototypes and consts now emits a warning under |
| 94 | + `unused_attribute` lint.][65294] Using `#[inline]` anywhere else inside traits |
| 95 | + or `extern` blocks now correctly emits a hard error. |
| 96 | + |
| 97 | +[65294]: https://github.com/rust-lang/rust/pull/65294/ |
| 98 | +[66103]: https://github.com/rust-lang/rust/pull/66103/ |
| 99 | +[65843]: https://github.com/rust-lang/rust/pull/65843/ |
| 100 | +[65188]: https://github.com/rust-lang/rust/pull/65188/ |
| 101 | +[65092]: https://github.com/rust-lang/rust/pull/65092/ |
| 102 | +[64589]: https://github.com/rust-lang/rust/pull/64589/ |
| 103 | +[64639]: https://github.com/rust-lang/rust/pull/64639/ |
| 104 | +[64221]: https://github.com/rust-lang/rust/pull/64221/ |
| 105 | +[64284]: https://github.com/rust-lang/rust/pull/64284/ |
| 106 | +[63931]: https://github.com/rust-lang/rust/pull/63931/ |
| 107 | +[64035]: https://github.com/rust-lang/rust/pull/64035/ |
| 108 | +[63674]: https://github.com/rust-lang/rust/pull/63674/ |
| 109 | +[63803]: https://github.com/rust-lang/rust/pull/63803/ |
| 110 | +[cargo/7450]: https://github.com/rust-lang/cargo/pull/7450/ |
| 111 | +[cargo/7507]: https://github.com/rust-lang/cargo/pull/7507/ |
| 112 | +[cargo/7525]: https://github.com/rust-lang/cargo/pull/7525/ |
| 113 | +[cargo/7333]: https://github.com/rust-lang/cargo/pull/7333/ |
| 114 | +[(rfc 2008)]: https://rust-lang.github.io/rfcs/2008-non-exhaustive.html |
| 115 | +[`f32::to_be_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_be_bytes |
| 116 | +[`f32::to_le_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_le_bytes |
| 117 | +[`f32::to_ne_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_ne_bytes |
| 118 | +[`f64::to_be_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_be_bytes |
| 119 | +[`f64::to_le_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_le_bytes |
| 120 | +[`f64::to_ne_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_ne_bytes |
| 121 | +[`f32::from_be_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.from_be_bytes |
| 122 | +[`f32::from_le_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.from_le_bytes |
| 123 | +[`f32::from_ne_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.from_ne_bytes |
| 124 | +[`f64::from_be_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.from_be_bytes |
| 125 | +[`f64::from_le_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.from_le_bytes |
| 126 | +[`f64::from_ne_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.from_ne_bytes |
| 127 | +[`option::flatten`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.flatten |
| 128 | +[`option::as_deref`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.as_deref |
| 129 | +[`option::as_deref_mut`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.as_deref_mut |
| 130 | +[`hashmap::get_key_value`]: https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.get_key_value |
| 131 | +[`btreemap::get_key_value`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html#method.get_key_value |
| 132 | +[`slice::repeat`]: https://doc.rust-lang.org/std/primitive.slice.html#method.repeat |
| 133 | +[`mem::take`]: https://doc.rust-lang.org/std/mem/fn.take.html |
| 134 | +[`udpsocket::peer_addr`]: https://doc.rust-lang.org/std/net/struct.UdpSocket.html#method.peer_addr |
| 135 | +[`todo!`]: https://doc.rust-lang.org/std/macro.todo.html |
| 136 | + |
| 137 | + |
1 | 138 | Version 1.39.0 (2019-11-07)
|
2 | 139 | ===========================
|
3 | 140 |
|
|
0 commit comments