|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "Announcing Rust 1.75.0" |
| 4 | +author: The Rust Release Team |
| 5 | +release: true |
| 6 | +--- |
| 7 | + |
| 8 | +The Rust team is happy to announce a new version of Rust, 1.75.0. Rust is a programming language empowering everyone to build reliable and efficient software. |
| 9 | + |
| 10 | +If you have a previous version of Rust installed via rustup, you can get 1.75.0 with: |
| 11 | + |
| 12 | +```console |
| 13 | +rustup update stable |
| 14 | +``` |
| 15 | + |
| 16 | +If you don't have it already, you can [get `rustup`](https://www.rust-lang.org/install.html) from the appropriate page on our website, and check out the [detailed release notes for 1.75.0](https://doc.rust-lang.org/nightly/releases.html#version-1750-2023-12-28). |
| 17 | + |
| 18 | +If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (`rustup default beta`) or the nightly channel (`rustup default nightly`). Please [report](https://github.com/rust-lang/rust/issues/new/choose) any bugs you might come across! |
| 19 | + |
| 20 | +## What's in 1.75.0 stable |
| 21 | + |
| 22 | +### `async fn` and return-position `impl Trait` in traits |
| 23 | + |
| 24 | +As [announced](https://blog.rust-lang.org/2023/12/21/async-fn-rpit-in-traits.html) |
| 25 | +last week, Rust 1.75 supports use of `async fn` and `-> impl Trait` in traits. |
| 26 | +However, this initial release comes with some limitations that are described in |
| 27 | +the [announcement post](https://blog.rust-lang.org/2023/12/21/async-fn-rpit-in-traits.html#where-the-gaps-lie). |
| 28 | + |
| 29 | +It's expected that these limitations will be lifted in future releases. |
| 30 | + |
| 31 | +### Pointer byte offset APIs |
| 32 | + |
| 33 | +Raw pointers (`*const T` and `*mut T`) used to primarily support operations |
| 34 | +operating in units of `T`. For example, `<*const T>::add(1)` would add |
| 35 | +`size_of::<T>()` bytes to the pointer's address. In some cases, working with |
| 36 | +byte offsets is more convenient, and these new APIs avoid requiring callers to |
| 37 | +cast to `*const u8`/`*mut u8` first. |
| 38 | + |
| 39 | +- [`pointer::byte_add`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_add) |
| 40 | +- [`pointer::byte_offset`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_offset) |
| 41 | +- [`pointer::byte_offset_from`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_offset_from) |
| 42 | +- [`pointer::byte_sub`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_sub) |
| 43 | +- [`pointer::wrapping_byte_add`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.wrapping_byte_add) |
| 44 | +- [`pointer::wrapping_byte_offset`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.wrapping_byte_offset) |
| 45 | +- [`pointer::wrapping_byte_sub`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.wrapping_byte_sub) |
| 46 | + |
| 47 | +### Code layout optimizations for rustc |
| 48 | + |
| 49 | +The Rust compiler continues to get faster, with this release including the |
| 50 | +application of |
| 51 | +[BOLT](https://github.com/llvm/llvm-project/blob/main/bolt/README.md) to our |
| 52 | +binary releases, bringing a 2% mean wall time improvements on our |
| 53 | +benchmarks. This tool optimizes the layout of the `librustc_driver.so` library |
| 54 | +containing most of the rustc code, allowing for better cache utilization. |
| 55 | + |
| 56 | +We are also now building rustc with `-Ccodegen-units=1`, which provides more |
| 57 | +opportunity for optimizations in LLVM. This optimization brought a separate |
| 58 | +1.5% wall time mean win to our benchmarks. |
| 59 | + |
| 60 | +In this release these optimizations are limited to `x86_64-unknown-linux-gnu` |
| 61 | +compilers, but we expect to expand that over time to include more platforms. |
| 62 | + |
| 63 | +### Stabilized APIs |
| 64 | + |
| 65 | +- [`Atomic*::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicUsize.html#method.from_ptr) |
| 66 | +- [`FileTimes`](https://doc.rust-lang.org/stable/std/fs/struct.FileTimes.html) |
| 67 | +- [`FileTimesExt`](https://doc.rust-lang.org/stable/std/os/windows/fs/trait.FileTimesExt.html) |
| 68 | +- [`File::set_modified`](https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.set_modified) |
| 69 | +- [`File::set_times`](https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.set_times) |
| 70 | +- [`IpAddr::to_canonical`](https://doc.rust-lang.org/stable/core/net/enum.IpAddr.html#method.to_canonical) |
| 71 | +- [`Ipv6Addr::to_canonical`](https://doc.rust-lang.org/stable/core/net/struct.Ipv6Addr.html#method.to_canonical) |
| 72 | +- [`Option::as_slice`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.as_slice) |
| 73 | +- [`Option::as_mut_slice`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.as_mut_slice) |
| 74 | +- [`pointer::byte_add`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_add) |
| 75 | +- [`pointer::byte_offset`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_offset) |
| 76 | +- [`pointer::byte_offset_from`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_offset_from) |
| 77 | +- [`pointer::byte_sub`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_sub) |
| 78 | +- [`pointer::wrapping_byte_add`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.wrapping_byte_add) |
| 79 | +- [`pointer::wrapping_byte_offset`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.wrapping_byte_offset) |
| 80 | +- [`pointer::wrapping_byte_sub`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.wrapping_byte_sub) |
| 81 | + |
| 82 | +These APIs are now stable in const contexts: |
| 83 | + |
| 84 | +- [`Ipv6Addr::to_ipv4_mapped`](https://doc.rust-lang.org/stable/core/net/struct.Ipv6Addr.html#method.to_ipv4_mapped) |
| 85 | +- [`MaybeUninit::assume_init_read`](https://doc.rust-lang.org/stable/core/mem/union.MaybeUninit.html#method.assume_init_read) |
| 86 | +- [`MaybeUninit::zeroed`](https://doc.rust-lang.org/stable/core/mem/union.MaybeUninit.html#method.zeroed) |
| 87 | +- [`mem::discriminant`](https://doc.rust-lang.org/stable/core/mem/fn.discriminant.html) |
| 88 | +- [`mem::zeroed`](https://doc.rust-lang.org/stable/core/mem/fn.zeroed.html) |
| 89 | + |
| 90 | +### Other changes |
| 91 | + |
| 92 | +Check out everything that changed in [Rust](https://github.com/rust-lang/rust/releases/tag/1.75.0), [Cargo](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-175-2023-12-28), and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-175). |
| 93 | + |
| 94 | +## Contributors to 1.75.0 |
| 95 | + |
| 96 | +Many people came together to create Rust 1.75.0. We couldn't have done it without all of you. [Thanks!](https://thanks.rust-lang.org/rust/1.75.0/) |
0 commit comments