Skip to content

Commit 2621564

Browse files
authored
Update RELEASES.md
1 parent a496450 commit 2621564

File tree

1 file changed

+44
-25
lines changed

1 file changed

+44
-25
lines changed

RELEASES.md

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,44 @@ Language
55
--------
66
- [You can now use the `cfg(target_vendor)` attribute.][57465] E.g.
77
`#[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.
811
- [You can now have multiple patterns in `if let` and `while let`
912
expressions.][57532] You can do this with the same syntax as a `match`
1013
expression. E.g.
1114
```rust
1215
enum Creature {
13-
Crab(String),
14-
Person(String),
16+
Crab(String),
17+
Lobster(String),
18+
Person(String),
1519
}
1620

1721
fn main() {
18-
let state = Creature::Crab("Ferris");
22+
let state = Creature::Crab("Ferris");
1923

20-
if let Creature::Crab(name) | Creature::Person(name) = state {
21-
println!("This creature's name is: {}", name);
22-
}
24+
if let Creature::Crab(name) | Creature::Person(name) = state {
25+
println!("This creature's name is: {}", name);
26+
}
2327
}
2428
```
2529
- [You can now have irrefutable `if let` and `while let` patterns.][57535] Using
2630
this feature will by default produce a warning as this behaviour can be
2731
unintuitive. E.g. `if let _ = 5 {}`
2832
- [You can now use `let` bindings, assignments, expression statements, and pattern destructuring in
2933
const 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.
34+
- [You can now call unsafe const functions.][57067] E.g.
3635
```rust
3736
const unsafe fn foo() -> i32 { 5 }
3837
const fn bar() -> i32 {
3938
unsafe { foo() }
4039
}
4140
```
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.
4246
- [You can now import an item from a module as an `_`.][56303] This allows you to
4347
import a trait's impls, and not have the name in the namespace. E.g.
4448
```rust
@@ -64,13 +68,17 @@ Compiler
6468

6569
Libraries
6670
---------
67-
- [The functions `overflowing_{add, sub, mul, shl, shr}` are now constant
71+
- [The functions `overflowing_{add, sub, mul, shl, shr}` are now `const`
6872
functions for all numeric types.][57566]
69-
- [The `get` method for all `NonZero` types is now constant.][57167]
73+
- [The functions `rotate_left`, `rotate_right`, and `wrapping_{add, sub, mul, shl, shr}`
74+
are now `const` functions for all numeric types.][57105]
75+
- [The functions `is_positive` and `is_negative` are now `const` functions for
76+
all signed numeric types.][57105]
77+
- [The `get` method for all `NonZero` types is now `const`.][57167]
7078
- [The functions `count_ones`, `count_zeros`, `leading_zeros`, `trailing_zeros`,
71-
`swap_bytes`, `from_be`, `from_le`, `to_be`, `to_le` are now const for all
79+
`swap_bytes`, `from_be`, `from_le`, `to_be`, `to_le` are now `const` for all
7280
numeric types.][57234]
73-
- [`Ipv4Addr::new` is now a const function][57234]
81+
- [`Ipv4Addr::new` is now a `const` function][57234]
7482

7583
Stabilized APIs
7684
---------------
@@ -80,17 +88,25 @@ Stabilized APIs
8088
- [`Result::transpose`]
8189
- [`convert::identity`]
8290
- [`pin::Pin`]
91+
- [`marker::Unpin`]
92+
- [`marker::PhantomPinned`]
8393
- [`Vec::resize_with`]
8494
- [`VecDeque::resize_with`]
8595
- [`Duration::as_millis`]
8696
- [`Duration::as_micros`]
8797
- [`Duration::as_nanos`]
8898

99+
89100
Cargo
90101
-----
91102
- [Cargo should now rebuild a crate if a file was modified during the initial
92103
build.][cargo/6484]
93104

105+
Compatibility Notes
106+
-------------------
107+
- The functions `str::{trim_left, trim_right, trim_left_matches, trim_right_matches}`
108+
are now offically deprecated, and their usage will now produce a warning. Please use the
109+
`str::{trim_start, trim_end, trim_start_matches, trim_end_matches}` functions instead.
94110

95111
[57615]: https://github.com/rust-lang/rust/pull/57615/
96112
[57465]: https://github.com/rust-lang/rust/pull/57465/
@@ -110,18 +126,21 @@ Cargo
110126
[56303]: https://github.com/rust-lang/rust/pull/56303/
111127
[56351]: https://github.com/rust-lang/rust/pull/56351/
112128
[55982]: https://github.com/rust-lang/rust/pull/55982/
129+
[57105]: https://github.com/rust-lang/rust/pull/57105
113130
[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
131+
[`unix::FileExt::read_exact_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#method.read_exact_at
132+
[`unix::FileExt::write_exact_at`]: https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html#method.write_exact_at
133+
[`Option::transpose`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.transpose
134+
[`Result::transpose`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.transpose
118135
[`convert::identity`]: https://doc.rust-lang.org/std/convert/fn.identity.html
119136
[`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
137+
[`marker::Unpin`]: https://doc.rust-lang.org/stable/std/marker/trait.Unpin.html
138+
[`marker::PhantomPinned`]: https://doc.rust-lang.org/nightly/std/marker/struct.PhantomPinned.html
139+
[`Vec::resize_with`]: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.resize_with
140+
[`VecDeque::resize_with`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.resize_with
141+
[`Duration::as_millis`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_millis
142+
[`Duration::as_micros`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_micros
143+
[`Duration::as_nanos`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_nanos
125144
[platform-support]: https://forge.rust-lang.org/platform-support.html
126145

127146
Version 1.32.0 (2019-01-17)

0 commit comments

Comments
 (0)