|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>Announcing Rust 1.71.0 | Rust Blog</title> |
| 6 | + <meta name="viewport" content="width=device-width,initial-scale=1.0"> |
| 7 | +<meta name="description" content="Empowering everyone to build reliable and efficient software."> |
| 8 | + <!-- Twitter card --> |
| 9 | + <meta name="twitter:card" content="summary"> |
| 10 | + <meta name="twitter:site" content="@rustlang"> |
| 11 | + <meta name="twitter:creator" content="@rustlang"> |
| 12 | + <meta name="twitter:title" content="Announcing Rust 1.71.0 | Rust Blog"> |
| 13 | + <meta name="twitter:description" content="Empowering everyone to build reliable and efficient software."> |
| 14 | +<meta name="twitter:image" content="https://www.rust-lang.org/static/images/rust-social.jpg"> |
| 15 | + |
| 16 | +<!-- Facebook OpenGraph --> |
| 17 | +<meta property="og:title" content="Announcing Rust 1.71.0 | Rust Blog" /> |
| 18 | +<meta property="og:description" content="Empowering everyone to build reliable and efficient software."> |
| 19 | +<meta property="og:image" content="https://www.rust-lang.org/static/images/rust-social-wide.jpg" /> |
| 20 | +<meta property="og:type" content="website" /> |
| 21 | +<meta property="og:locale" content="en_US" /> |
| 22 | + |
| 23 | +<!-- styles --> |
| 24 | +<link rel="stylesheet" href="../../../styles/vendor.css"/> |
| 25 | +<link rel="stylesheet" href="../../../styles/fonts.css"/> |
| 26 | +<link rel="stylesheet" href="../../../styles/app.css"/> |
| 27 | +<link rel="stylesheet" href="../../../styles/highlight.css"/> |
| 28 | + |
| 29 | +<!-- favicon --> |
| 30 | +<link rel="apple-touch-icon" sizes="180x180" href="../../../images/apple-touch-icon.png"> |
| 31 | +<link rel="icon" type="image/png" sizes="16x16" href="../../../images/favicon-16x16.png"> |
| 32 | +<link rel="icon" type="image/png" sizes="32x32" href="../../../images/favicon-32x32.png"> |
| 33 | +<link rel="icon" type="image/svg+xml" href="../../../images/favicon.svg"> |
| 34 | +<link rel="manifest" href="../../../images/site.webmanifest"> |
| 35 | +<link rel="mask-icon" href="../../../images/safari-pinned-tab.svg" color="#5bbad5"> |
| 36 | +<meta name="msapplication-TileColor" content="#00aba9"> |
| 37 | +<meta name="theme-color" content="#ffffff"> |
| 38 | + |
| 39 | + <!-- atom --> |
| 40 | + <link type="application/atom+xml" rel="alternate" href="https://blog.rust-lang.org/feed.xml" title="Rust Blog" /> |
| 41 | + |
| 42 | + </head> |
| 43 | + <body> |
| 44 | + <nav class="flex flex-row justify-center justify-end-l items-center flex-wrap ph2 pl3-ns pr4-ns"> |
| 45 | + <div class="brand flex-auto w-100 w-auto-l self-start tc tl-l"> |
| 46 | + <a href="../../../"> |
| 47 | + <img class="v-mid ml0-l" alt="Rust Logo" src="../../../images/rust-logo-blk.svg"> |
| 48 | + <span class="dib ml1 ml0-l">Rust Blog</span> |
| 49 | + </a> |
| 50 | + </div> |
| 51 | + |
| 52 | + <ul class="nav list w-100 w-auto-l flex flex-none flex-row flex-wrap justify-center justify-end-l items-center pv2 ph0 ph4-ns"> |
| 53 | + <li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://www.rust-lang.org">Rust</a></li> |
| 54 | + <li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://www.rust-lang.org/tools/install">Install</a></li> |
| 55 | + <li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://www.rust-lang.org/learn">Learn</a></li> |
| 56 | + <li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://www.rust-lang.org/tools">Tools</a></li> |
| 57 | + <li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://www.rust-lang.org/governance">Governance</a></li> |
| 58 | + <li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://www.rust-lang.org/community">Community</a></li> |
| 59 | + </ul> |
| 60 | +</nav> |
| 61 | + |
| 62 | +<section id="Announcing Rust 1.71.0" class="white"> |
| 63 | + <div class="w-100 mw-none ph3 mw8-m mw8-l center f3"> |
| 64 | + <header> |
| 65 | + <h2>Announcing Rust 1.71.0</h2> |
| 66 | + <div class="highlight mt2 mb3"></div> |
| 67 | + </header> |
| 68 | + |
| 69 | + <div class="publish-date-author">July 13, 2023 · The Rust Release Team |
| 70 | + |
| 71 | + </div> |
| 72 | + |
| 73 | + <div class="post"> |
| 74 | + <p>The Rust team is happy to announce a new version of Rust, 1.71.0. Rust is a programming language empowering everyone to build reliable and efficient software.</p> |
| 75 | +<p>If you have a previous version of Rust installed via rustup, you can get 1.71.0 with:</p> |
| 76 | +<pre><code class="language-console">rustup update stable |
| 77 | +</code></pre> |
| 78 | +<p>If you don't have it already, you can <a href="https://www.rust-lang.org/install.html">get <code>rustup</code></a> from the appropriate page on our website, and check out the <a href="https://github.com/rust-lang/rust/releases/tag/1.71.0">detailed release notes for 1.71.0</a> on GitHub.</p> |
| 79 | +<p>If you'd like to help us out by testing future releases, you might consider updating locally to use the beta channel (<code>rustup default beta</code>) or the nightly channel (<code>rustup default nightly</code>). Please <a href="https://github.com/rust-lang/rust/issues/new/choose">report</a> any bugs you might come across!</p> |
| 80 | +<h2><a href="#whats-in-1710-stable" aria-hidden="true" class="anchor" id="whats-in-1710-stable"></a>What's in 1.71.0 stable</h2> |
| 81 | +<h3><a href="#c-unwind-abi" aria-hidden="true" class="anchor" id="c-unwind-abi"></a>C-unwind ABI</h3> |
| 82 | +<p>1.71.0 stabilizes <code>C-unwind</code> (and other <code>-unwind</code> suffixed ABI variants<sup class="footnote-ref"><a href="#fn1" id="fnref1">1</a></sup>).</p> |
| 83 | +<p>The behavior for unforced unwinding (the typical case) is specified in <a href="https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md#abi-boundaries-and-unforced-unwinding">this |
| 84 | +table from the RFC which proposed this feature</a>. To summarize:</p> |
| 85 | +<p>Each ABI is mostly equivalent to the same ABI without <code>-unwind</code>, except that |
| 86 | +with <code>-unwind</code> the behavior is defined to be safe when an unwinding operation |
| 87 | +(<code>panic</code> or C++ style exception) crosses the ABI boundary. For <code>panic=unwind</code>, |
| 88 | +this is a valid way to let exceptions from one language unwind the stack in |
| 89 | +another language without terminating the process (as long as the exception is |
| 90 | +caught in the same language from which it originated); for <code>panic=abort</code>, this |
| 91 | +will typically abort the process immediately.</p> |
| 92 | +<p>For this initial stabilization, <em>no change</em> is made to the existing ABIs (e.g. |
| 93 | +<code>"C"</code>), and unwinding across them remains undefined behavior. A future Rust |
| 94 | +release will amend these ABIs to match the behavior specified in the RFC as the |
| 95 | +final part in stabilizing this feature (usually aborting at the boundary). |
| 96 | +Users are encouraged to start using the new unwind ABI variants in their code |
| 97 | +to remain future proof if they need to unwind across the ABI boundary.</p> |
| 98 | +<h3><a href="#debugger-visualization-attributes" aria-hidden="true" class="anchor" id="debugger-visualization-attributes"></a>Debugger visualization attributes</h3> |
| 99 | +<p>1.71.0 stabilizes support for a new attribute, <code>#[debug_visualizer(natvis_file = "...")]</code> and <code>#[debug_visualizer(gdb_script_file = "...")]</code>, which allows |
| 100 | +embedding Natviz descriptions and GDB scripts into Rust libraries to |
| 101 | +improve debugger output when inspecting data structures created by those |
| 102 | +libraries. Rust itself has packaged similar scripts for some time for the |
| 103 | +standard library, but this feature makes it possible for library authors to |
| 104 | +provide a similar experience to end users.</p> |
| 105 | +<p>See the <a href="https://doc.rust-lang.org/nightly/reference/attributes/debugger.html#the-debugger_visualizer-attribute">reference</a> |
| 106 | +for details on usage.</p> |
| 107 | +<h3><a href="#raw-dylib-linking" aria-hidden="true" class="anchor" id="raw-dylib-linking"></a>raw-dylib linking</h3> |
| 108 | +<p>On Windows platforms, Rust now supports using functions from dynamic libraries without requiring those libraries to be available at build time, using the new <code>kind="raw-dylib”</code> option for <code>#[link]</code>.</p> |
| 109 | +<p>This avoids requiring users to install those libraries (particularly difficult for cross-compilation), and avoids having to ship stub versions of libraries in crates to link against. This simplifies crates providing bindings to Windows libraries.</p> |
| 110 | +<p>Rust also supports binding to symbols provided by DLLs by ordinal rather than named symbol, using the new <code>#[link_ordinal]</code> attribute.</p> |
| 111 | +<h3><a href="#upgrade-to-musl-12" aria-hidden="true" class="anchor" id="upgrade-to-musl-12"></a>Upgrade to musl 1.2</h3> |
| 112 | +<p>As <a href="https://blog.rust-lang.org/2023/05/09/Updating-musl-targets.html">previously announced</a>, |
| 113 | +Rust 1.71 updates the musl version to 1.2.3. Most users should not be affected by this change.</p> |
| 114 | +<h3><a href="#const-initialized-thread-locals" aria-hidden="true" class="anchor" id="const-initialized-thread-locals"></a>Const-initialized thread locals</h3> |
| 115 | +<p>Rust 1.59.0 stabilized <code>const</code> initialized thread local support in the standard |
| 116 | +library, which allows for more optimal code generation. However, until now this |
| 117 | +feature was missed in release notes and |
| 118 | +<a href="https://doc.rust-lang.org/stable/std/macro.thread_local.html">documentation</a>. |
| 119 | +Note that this stabilization does not make <code>const { ... }</code> a valid expression |
| 120 | +or syntax in other contexts; that is a separate and currently unstable |
| 121 | +<a href="https://github.com/rust-lang/rust/issues/76001">feature</a>.</p> |
| 122 | +<pre><code class="language-rust">use std::cell::Cell; |
| 123 | + |
| 124 | +thread_local! { |
| 125 | + pub static FOO: Cell<u32> = const { Cell::new(1) }; |
| 126 | +} |
| 127 | +</code></pre> |
| 128 | +<h3><a href="#stabilized-apis" aria-hidden="true" class="anchor" id="stabilized-apis"></a>Stabilized APIs</h3> |
| 129 | +<ul> |
| 130 | +<li><a href="https://doc.rust-lang.org/stable/std/ffi/struct.CStr.html#method.is_empty"><code>CStr::is_empty</code></a></li> |
| 131 | +<li><a href="https://doc.rust-lang.org/stable/std/hash/trait.BuildHasher.html#method.hash_one"><code>BuildHasher::hash_one</code></a></li> |
| 132 | +<li><a href="https://doc.rust-lang.org/stable/std/num/struct.NonZeroI32.html#method.is_positive"><code>NonZeroI*::is_positive</code></a></li> |
| 133 | +<li><a href="https://doc.rust-lang.org/stable/std/num/struct.NonZeroI32.html#method.is_negative"><code>NonZeroI*::is_negative</code></a></li> |
| 134 | +<li><a href="https://doc.rust-lang.org/stable/std/num/struct.NonZeroI32.html#method.checked_neg"><code>NonZeroI*::checked_neg</code></a></li> |
| 135 | +<li><a href="https://doc.rust-lang.org/stable/std/num/struct.NonZeroI32.html#method.overflowing_neg"><code>NonZeroI*::overflowing_neg</code></a></li> |
| 136 | +<li><a href="https://doc.rust-lang.org/stable/std/num/struct.NonZeroI32.html#method.saturating_neg"><code>NonZeroI*::saturating_neg</code></a></li> |
| 137 | +<li><a href="https://doc.rust-lang.org/stable/std/num/struct.NonZeroI32.html#method.wrapping_neg"><code>NonZeroI*::wrapping_neg</code></a></li> |
| 138 | +<li><a href="https://doc.rust-lang.org/stable/std/num/struct.NonZeroI32.html#impl-Neg-for-NonZeroI32"><code>Neg for NonZeroI*</code></a></li> |
| 139 | +<li><a href="https://doc.rust-lang.org/stable/std/num/struct.NonZeroI32.html#impl-Neg-for-%26NonZeroI32"><code>Neg for &NonZeroI*</code></a></li> |
| 140 | +<li><a href="https://doc.rust-lang.org/stable/std/primitive.array.html#impl-From%3C%5BT;+1%5D%3E-for-(T,)"><code>From<[T; N]> for (T...)</code></a> |
| 141 | +(array to N-tuple for N in 1..=12)</li> |
| 142 | +<li><a href="https://doc.rust-lang.org/stable/std/primitive.array.html#impl-From%3C(T,)%3E-for-%5BT;+1%5D"><code>From<(T...)> for [T; N]</code></a> |
| 143 | +(N-tuple to array for N in 1..=12)</li> |
| 144 | +<li><a href="https://doc.rust-lang.org/stable/std/os/windows/io/trait.AsHandle.html#impl-AsHandle-for-Box%3CT%3E"><code>windows::io::AsHandle for Box<T></code></a></li> |
| 145 | +<li><a href="https://doc.rust-lang.org/stable/std/os/windows/io/trait.AsHandle.html#impl-AsHandle-for-Rc%3CT%3E"><code>windows::io::AsHandle for Rc<T></code></a></li> |
| 146 | +<li><a href="https://doc.rust-lang.org/stable/std/os/windows/io/trait.AsHandle.html#impl-AsHandle-for-Arc%3CT%3E"><code>windows::io::AsHandle for Arc<T></code></a></li> |
| 147 | +<li><a href="https://doc.rust-lang.org/stable/std/os/windows/io/trait.AsSocket.html#impl-AsSocket-for-Box%3CT%3E"><code>windows::io::AsSocket for Box<T></code></a></li> |
| 148 | +<li><a href="https://doc.rust-lang.org/stable/std/os/windows/io/trait.AsSocket.html#impl-AsSocket-for-Rc%3CT%3E"><code>windows::io::AsSocket for Rc<T></code></a></li> |
| 149 | +<li><a href="https://doc.rust-lang.org/stable/std/os/windows/io/trait.AsSocket.html#impl-AsSocket-for-Arc%3CT%3E"><code>windows::io::AsSocket for Arc<T></code></a></li> |
| 150 | +</ul> |
| 151 | +<p>These APIs are now stable in const contexts:</p> |
| 152 | +<ul> |
| 153 | +<li><a href="https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.read"><code><*const T>::read</code></a></li> |
| 154 | +<li><a href="https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.read_unaligned"><code><*const T>::read_unaligned</code></a></li> |
| 155 | +<li><a href="https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.read-1"><code><*mut T>::read</code></a></li> |
| 156 | +<li><a href="https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.read_unaligned-1"><code><*mut T>::read_unaligned</code></a></li> |
| 157 | +<li><a href="https://doc.rust-lang.org/stable/std/ptr/fn.read.html"><code>ptr::read</code></a></li> |
| 158 | +<li><a href="https://doc.rust-lang.org/stable/std/ptr/fn.read_unaligned.html"><code>ptr::read_unaligned</code></a></li> |
| 159 | +<li><a href="https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_at"><code><[T]>::split_at</code></a></li> |
| 160 | +</ul> |
| 161 | +<h3><a href="#other-changes" aria-hidden="true" class="anchor" id="other-changes"></a>Other changes</h3> |
| 162 | +<p>Check out everything that changed in <a href="https://github.com/rust-lang/rust/releases/tag/1.71.0">Rust</a>, <a href="https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-171-2023-07-13">Cargo</a>, and <a href="https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-171">Clippy</a>.</p> |
| 163 | +<h2><a href="#contributors-to-1710" aria-hidden="true" class="anchor" id="contributors-to-1710"></a>Contributors to 1.71.0</h2> |
| 164 | +<p>Many people came together to create Rust 1.71.0. We couldn't have done it without all of you. <a href="https://thanks.rust-lang.org/rust/1.71.0/">Thanks!</a></p> |
| 165 | +<section class="footnotes"> |
| 166 | +<ol> |
| 167 | +<li id="fn1"> |
| 168 | +<p>List of stabilized ABIs can be found in the stabilization report: https://github.com/rust-lang/rust/issues/74990#issuecomment-1363473645 <a href="#fnref1" class="footnote-backref">↩</a></p> |
| 169 | +</li> |
| 170 | +</ol> |
| 171 | +</section> |
| 172 | + |
| 173 | + </div> |
| 174 | + </div> |
| 175 | +</section> |
| 176 | + |
| 177 | + <footer> |
| 178 | + <div class="w-100 mw-none ph3 mw8-m mw9-l center f3"> |
| 179 | + <div class="row"> |
| 180 | + <div class="four columns mt3 mt0-l" id="get-help"> |
| 181 | + <h4>Get help!</h4> |
| 182 | + <ul> |
| 183 | + <li><a href="https://doc.rust-lang.org" target="_blank" rel="noopener">Documentation</a></li> |
| 184 | + <li><a href="mailto:core-team@rust-lang.org">Contact the Rust Team</a></li> |
| 185 | + </ul> |
| 186 | + </div> |
| 187 | + <div class="four columns mt3 mt0-l"> |
| 188 | + <h4>Terms and policies</h4> |
| 189 | + <ul> |
| 190 | + <li><a href="https://www.rust-lang.org/policies/code-of-conduct">Code of Conduct</a></li> |
| 191 | + <li><a href="https://www.rust-lang.org/policies/licenses">Licenses</a></li> |
| 192 | + <li><a href="https://www.rust-lang.org/policies/media-guide">Logo Policy and Media Guide</a></li> |
| 193 | + <li><a href="https://www.rust-lang.org/policies/security">Security Disclosures</a></li> |
| 194 | + <li><a href="https://www.rust-lang.org/policies">All Policies</a></li> |
| 195 | + </ul> |
| 196 | + </div> |
| 197 | + <div class="four columns mt3 mt0-l"> |
| 198 | + <h4>Social</h4> |
| 199 | + <div class="flex flex-row flex-wrap"> |
| 200 | + <a href="https://twitter.com/rustlang" target="_blank" rel="noopener" alt="twitter link"><img src="../../../images/twitter.svg" alt="twitter logo" title="Twitter"/></a> |
| 201 | + <a href="https://www.youtube.com/channel/UCaYhcUwRBNscFNUKTjgPFiA" target="_blank" rel="noopener" alt="youtube link"><img style="padding-top: 6px; padding-bottom:6px" src="../../../images/youtube.svg" alt="youtube logo" title="YouTube"/></a> |
| 202 | + <a href="https://discord.gg/rust-lang" target="_blank" rel="noopener" alt="discord link"><img src="../../../images/discord.svg" alt="discord logo" title="Discord"/></a> |
| 203 | + <a href="https://github.com/rust-lang" target="_blank" rel="noopener" alt="github link"><img src="../../../images/github.svg" alt="github logo" title="GitHub"/></a> |
| 204 | + </div> |
| 205 | + <h4 class="mt4 mb3">RSS</h4> |
| 206 | + <ul> |
| 207 | + <li><a href="../../../feed.xml">Main Blog</a></li> |
| 208 | + <li><a href="../../../inside-rust/feed.xml">"Inside Rust" Blog</a></li> |
| 209 | + </ul> |
| 210 | + </div> |
| 211 | + |
| 212 | + </div> |
| 213 | + <div class="attribution"> |
| 214 | + Maintained by the Rust Team. See a typo? |
| 215 | + <a href="https://github.com/rust-lang/blog.rust-lang.org" target="_blank" rel="noopener">Send a fix here</a>! |
| 216 | + </div> |
| 217 | + </div> |
| 218 | +</footer> |
| 219 | + |
| 220 | +<!-- scripts --> |
| 221 | +<script src="../../../scripts/highlight.js"></script> |
| 222 | + |
| 223 | + </body> |
| 224 | +</html> |
0 commit comments