- Remove duplicate tool header (lib.rs already prints it) - Add newline before timing footer for visual separation - Remove spinner animation (incompatible with update_tool_output_line) - Change shell command format to " > `cmd` ..." with 60 char width
231 lines
36 KiB
HTML
231 lines
36 KiB
HTML
<html lang="en" data-theme="dark"><head>
|
|
<meta charset="utf-8">
|
|
<title>Announcing Rust 1.92.0 | Rust Blog</title>
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
<meta name="description" content="Empowering everyone to build reliable and efficient software.">
|
|
<!-- Twitter card -->
|
|
<meta name="twitter:card" content="summary">
|
|
<meta name="twitter:site" content="@rustlang">
|
|
<meta name="twitter:creator" content="@rustlang">
|
|
<meta name="twitter:title" content="Announcing Rust 1.92.0 | Rust Blog">
|
|
<meta name="twitter:description" content="Empowering everyone to build reliable and efficient software.">
|
|
<meta name="twitter:image" content="https://www.rust-lang.org/static/images/rust-social.jpg">
|
|
|
|
<!-- Facebook OpenGraph -->
|
|
<meta property="og:title" content="Announcing Rust 1.92.0 | Rust Blog">
|
|
<meta property="og:description" content="Empowering everyone to build reliable and efficient software.">
|
|
<meta property="og:image" content="https://www.rust-lang.org/static/images/rust-social-wide.jpg">
|
|
<meta property="og:type" content="website">
|
|
<meta property="og:locale" content="en_US">
|
|
|
|
<!-- styles -->
|
|
<link rel="stylesheet" href="https://blog.rust-lang.org/styles/skeleton.css">
|
|
<link rel="stylesheet" href="https://blog.rust-lang.org/styles/tachyons.css">
|
|
<link rel="stylesheet" href="https://blog.rust-lang.org/styles/fonts.css">
|
|
<link rel="stylesheet" href="https://blog.rust-lang.org/styles/app.css">
|
|
<link rel="stylesheet" type="text/css" id="syntax-theme" href="/styles/syntax-theme-dark.css">
|
|
|
|
<!-- stylesheet for user agents without js -->
|
|
<noscript>
|
|
<link rel="stylesheet" href="https://blog.rust-lang.org/styles/noscript.css">
|
|
<link rel="stylesheet" type="text/css" href="/styles/syntax-theme-dark.css" media="(prefers-color-scheme: dark)" />
|
|
<link rel="stylesheet" type="text/css" href="/styles/syntax-theme-light.css" media="(prefers-color-scheme: light)" />
|
|
</noscript>
|
|
|
|
<!-- favicon -->
|
|
<link rel="apple-touch-icon" sizes="180x180" href="https://blog.rust-lang.org/images/apple-touch-icon.png">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="https://blog.rust-lang.org/images/favicon-16x16.png">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="https://blog.rust-lang.org/images/favicon-32x32.png">
|
|
<link rel="icon" type="image/svg+xml" href="https://blog.rust-lang.org/images/favicon.svg">
|
|
<link rel="manifest" href="https://blog.rust-lang.org/images/site.webmanifest">
|
|
<link rel="mask-icon" href="https://blog.rust-lang.org/images/safari-pinned-tab.svg" color="#5bbad5">
|
|
<meta name="msapplication-TileColor" content="#00aba9">
|
|
<meta name="theme-color" content="#ffffff">
|
|
|
|
<!-- atom -->
|
|
<link type="application/atom+xml" rel="alternate" href="https://blog.rust-lang.org/feed.xml" title="Rust Blog">
|
|
|
|
<!-- theme switcher -->
|
|
<script src="https://blog.rust-lang.org/scripts/theme-switch.js"></script>
|
|
</head>
|
|
<body>
|
|
<nav class="flex flex-row justify-center justify-end-l items-center flex-wrap ph2 pl3-ns pr4-ns">
|
|
<div class="brand flex-auto w-100 w-auto-l self-start tc tl-l">
|
|
<a href="https://blog.rust-lang.org/">
|
|
<img class="v-mid ml0-l rust-logo" alt="" src="https://blog.rust-lang.org/images/rust-logo-blk.svg">
|
|
<span class="dib ml1 ml0-l">Rust Blog</span>
|
|
</a>
|
|
</div>
|
|
|
|
<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">
|
|
<li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://www.rust-lang.org">Rust</a></li>
|
|
<li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://www.rust-lang.org/tools/install">Install</a></li>
|
|
<li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://www.rust-lang.org/learn">Learn</a></li>
|
|
<li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://www.rust-lang.org/tools">Tools</a></li>
|
|
<li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://www.rust-lang.org/governance">Governance</a></li>
|
|
<li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://www.rust-lang.org/community">Community</a></li>
|
|
<button class="theme-icon" onclick="dropdown();" style="display: block;">🖌
|
|
<ul id="theme-choice">
|
|
<li class="theme-item" onclick="changeThemeTo('light');">Light</li>
|
|
<li class="theme-item" onclick="changeThemeTo('dark');">Dark</li>
|
|
<li class="theme-item" onclick="changeThemeTo('system');">System</li>
|
|
</ul>
|
|
</button>
|
|
<script src="https://blog.rust-lang.org/scripts/theme-switch-post.js"></script>
|
|
</ul>
|
|
</nav><section id="Announcing Rust 1.92.0" class="white">
|
|
<div class="w-100 mw-none ph3 mw8-m mw8-l center f3">
|
|
<header>
|
|
<h2>Announcing Rust 1.92.0</h2>
|
|
<div class="highlight mt2 mb3"></div>
|
|
</header>
|
|
|
|
<div class="publish-date-author">Dec. 11, 2025 · The Rust Release Team
|
|
|
|
</div>
|
|
|
|
<div class="post">
|
|
<p>The Rust team is happy to announce a new version of Rust, 1.92.0. Rust is a programming language empowering everyone to build reliable and efficient software.</p>
|
|
<p>If you have a previous version of Rust installed via <code>rustup</code>, you can get 1.92.0 with:</p>
|
|
<pre data-lang="console" class="language-console z-code"><code class="language-console" data-lang="console"><span class="z-text z-plain">$ rustup update stable
|
|
</span></code></pre>
|
|
<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://doc.rust-lang.org/stable/releases.html#version-1920-2025-12-11">detailed release notes for 1.92.0</a>.</p>
|
|
<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>
|
|
<h2 id="what-s-in-1-92-0-stable"><a class="anchor" href="#what-s-in-1-92-0-stable" aria-hidden="true"></a>
|
|
What's in 1.92.0 stable</h2>
|
|
<h3 id="deny-by-default-never-type-lints"><a class="anchor" href="#deny-by-default-never-type-lints" aria-hidden="true"></a>
|
|
Deny-by-default never type lints</h3>
|
|
<p>The language and compiler teams continue to work on stabilization of the <a href="https://doc.rust-lang.org/stable/std/primitive.never.html">never type</a>. In this release the <a href="https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html#never-type-fallback-flowing-into-unsafe"><code>never_type_fallback_flowing_into_unsafe</code></a> and <a href="https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html#dependency-on-unit-never-type-fallback"><code>dependency_on_unit_never_type_fallback</code></a> future compatibility lints were made deny-by-default, meaning they will cause a compilation error when detected.</p>
|
|
<p>It's worth noting that while this can result in compilation errors, it is still a <em>lint;</em> these lints can all be <code>#[allow]</code>ed. These lints also will only fire when building the affected crates directly, not when they are built as dependencies (though a warning will be reported by Cargo in such cases).</p>
|
|
<p>These lints detect code which is likely to be broken by the never type stabilization. It is highly advised to fix them if they are reported in your crate graph.</p>
|
|
<p>We believe there to be approximately 500 crates affected by this lint. Despite that, we believe this to be acceptable, as lints are not a breaking change and it will allow for stabilizing the never type in the future. For more in-depth justification, see the <a href="https://github.com/rust-lang/rust/pull/146167#issuecomment-3363795006">Language Team's assessment</a>.</p>
|
|
<h3 id="unused-must-use-no-longer-warns-about-result-uninhabitedtype"><a class="anchor" href="#unused-must-use-no-longer-warns-about-result-uninhabitedtype" aria-hidden="true"></a>
|
|
<code>unused_must_use</code> no longer warns about <code>Result<(), UninhabitedType></code></h3>
|
|
<p>Rust's <code>unused_must_use</code> lint warns when ignoring the return value of a function, if the function or its return type is annotated with <code>#[must_use]</code>. For instance, this warns if ignoring a return type of <code>Result</code>, to remind you to use <code>?</code>, or something like <code>.expect("...")</code>.</p>
|
|
<p>However, some functions return <code>Result</code>, but the error type they use is not actually "inhabited", meaning you cannot construct any values of that type (e.g. the <a href="https://doc.rust-lang.org/std/primitive.never.html"><code>!</code></a> or <a href="https://doc.rust-lang.org/std/convert/enum.Infallible.html"><code>Infallible</code></a> types).</p>
|
|
<p>The <code>unused_must_use</code> lint now no longer warns on <code>Result<(), UninhabitedType></code>, or on <code>ControlFlow<UninhabitedType, ()></code>. For instance, it will not warn on <code>Result<(), Infallible></code>. This avoids having to check for an error that can never happen.</p>
|
|
<pre data-lang="rust" class="language-rust z-code"><code class="language-rust" data-lang="rust"><span class="z-source z-rust"><span class="z-keyword z-other z-rust">use</span> <span class="z-meta z-path z-rust">core<span class="z-punctuation z-accessor z-rust">::</span></span><span class="z-meta z-path z-rust">convert<span class="z-punctuation z-accessor z-rust">::</span></span>Infallible<span class="z-punctuation z-terminator z-rust">;</span>
|
|
</span><span class="z-source z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-function z-rust"><span class="z-storage z-type z-function z-rust">fn</span> </span><span class="z-entity z-name z-function z-rust">can_never_fail</span></span><span class="z-meta z-function z-rust"><span class="z-meta z-function z-parameters z-rust"><span class="z-punctuation z-section z-parameters z-begin z-rust">(</span></span><span class="z-meta z-function z-rust"><span class="z-meta z-function z-parameters z-rust"><span class="z-punctuation z-section z-parameters z-end z-rust">)</span></span></span></span><span class="z-meta z-function z-rust"> <span class="z-meta z-function z-return-type z-rust"><span class="z-punctuation z-separator z-rust">-></span> <span class="z-meta z-generic z-rust"><span class="z-support z-type z-rust">Result</span><span class="z-punctuation z-definition z-generic z-begin z-rust"><</span><span class="z-punctuation z-section z-group z-begin z-rust">(</span><span class="z-punctuation z-section z-group z-end z-rust">)</span>, Infallible<span class="z-punctuation z-definition z-generic z-end z-rust">></span></span></span> </span><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-begin z-rust">{</span>
|
|
</span></span></span><span class="z-source z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"> <span class="z-comment z-line z-double-slash z-rust"><span class="z-punctuation z-definition z-comment z-rust">//</span> ...
|
|
</span></span></span></span><span class="z-source z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"> <span class="z-support z-type z-rust">Ok</span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-begin z-rust">(</span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-begin z-rust">(</span></span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-end z-rust">)</span></span></span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-end z-rust">)</span></span>
|
|
</span></span></span><span class="z-source z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"></span><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-end z-rust">}</span></span></span>
|
|
</span><span class="z-source z-rust">
|
|
</span><span class="z-source z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-function z-rust"><span class="z-storage z-type z-function z-rust">fn</span> </span><span class="z-entity z-name z-function z-rust">main</span></span><span class="z-meta z-function z-rust"><span class="z-meta z-function z-parameters z-rust"><span class="z-punctuation z-section z-parameters z-begin z-rust">(</span></span><span class="z-meta z-function z-rust"><span class="z-meta z-function z-parameters z-rust"><span class="z-punctuation z-section z-parameters z-end z-rust">)</span></span></span></span><span class="z-meta z-function z-rust"> </span><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-begin z-rust">{</span>
|
|
</span></span></span><span class="z-source z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"> <span class="z-support z-function z-rust">can_never_fail</span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-begin z-rust">(</span></span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-end z-rust">)</span></span><span class="z-punctuation z-terminator z-rust">;</span>
|
|
</span></span></span><span class="z-source z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"></span><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-end z-rust">}</span></span></span>
|
|
</span></code></pre>
|
|
<p>This is particularly useful with the common pattern of a trait with an associated error type, where the error type may <em>sometimes</em> be infallible:</p>
|
|
<pre data-lang="rust" class="language-rust z-code"><code class="language-rust" data-lang="rust"><span class="z-source z-rust"><span class="z-meta z-trait z-rust"><span class="z-storage z-type z-trait z-rust">trait</span> <span class="z-entity z-name z-trait z-rust">UsesAssocErrorType</span> <span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-begin z-rust">{</span>
|
|
</span></span></span><span class="z-source z-rust"><span class="z-meta z-trait z-rust"><span class="z-meta z-block z-rust"> <span class="z-storage z-type z-type z-rust">type</span> <span class="z-entity z-name z-type z-rust">Error</span><span class="z-punctuation z-terminator z-rust">;</span>
|
|
</span></span></span><span class="z-source z-rust"><span class="z-meta z-trait z-rust"><span class="z-meta z-block z-rust"> <span class="z-meta z-function z-rust"><span class="z-meta z-function z-rust"><span class="z-storage z-type z-function z-rust">fn</span> </span><span class="z-entity z-name z-function z-rust">method</span></span><span class="z-meta z-function z-rust"><span class="z-meta z-function z-parameters z-rust"><span class="z-punctuation z-section z-parameters z-begin z-rust">(</span><span class="z-keyword z-operator z-rust">&</span><span class="z-variable z-parameter z-rust">self</span></span><span class="z-meta z-function z-rust"><span class="z-meta z-function z-parameters z-rust"><span class="z-punctuation z-section z-parameters z-end z-rust">)</span></span></span></span><span class="z-meta z-function z-rust"> <span class="z-meta z-function z-return-type z-rust"><span class="z-punctuation z-separator z-rust">-></span> <span class="z-meta z-generic z-rust"><span class="z-support z-type z-rust">Result</span><span class="z-punctuation z-definition z-generic z-begin z-rust"><</span><span class="z-punctuation z-section z-group z-begin z-rust">(</span><span class="z-punctuation z-section z-group z-end z-rust">)</span>, <span class="z-meta z-path z-rust"><span class="z-storage z-type z-rust"><span class="z-storage z-type z-rust">Self</span><span class="z-punctuation z-accessor z-rust">::</span></span></span>Error<span class="z-punctuation z-definition z-generic z-end z-rust">></span></span></span></span><span class="z-punctuation z-terminator z-rust">;</span>
|
|
</span></span></span><span class="z-source z-rust"><span class="z-meta z-trait z-rust"><span class="z-meta z-block z-rust"></span><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-end z-rust">}</span></span></span>
|
|
</span><span class="z-source z-rust">
|
|
</span><span class="z-source z-rust"><span class="z-meta z-struct z-rust"><span class="z-storage z-type z-struct z-rust">struct</span> </span><span class="z-meta z-struct z-rust"><span class="z-entity z-name z-struct z-rust">CannotFail</span></span><span class="z-punctuation z-terminator z-rust">;</span>
|
|
</span><span class="z-source z-rust"><span class="z-meta z-impl z-rust"><span class="z-storage z-type z-impl z-rust">impl</span> </span><span class="z-meta z-impl z-rust">UsesAssocErrorType <span class="z-keyword z-other z-rust">for</span></span><span class="z-meta z-impl z-rust"> <span class="z-entity z-name z-impl z-rust">CannotFail</span> </span><span class="z-meta z-impl z-rust"><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-begin z-rust">{</span>
|
|
</span></span></span><span class="z-source z-rust"><span class="z-meta z-impl z-rust"><span class="z-meta z-block z-rust"> <span class="z-storage z-type z-type z-rust">type</span> <span class="z-entity z-name z-type z-rust">Error</span> <span class="z-keyword z-operator z-assignment z-rust">=</span> <span class="z-meta z-path z-rust">core<span class="z-punctuation z-accessor z-rust">::</span></span><span class="z-meta z-path z-rust">convert<span class="z-punctuation z-accessor z-rust">::</span></span>Infallible<span class="z-punctuation z-terminator z-rust">;</span>
|
|
</span></span></span><span class="z-source z-rust"><span class="z-meta z-impl z-rust"><span class="z-meta z-block z-rust"> <span class="z-meta z-function z-rust"><span class="z-meta z-function z-rust"><span class="z-storage z-type z-function z-rust">fn</span> </span><span class="z-entity z-name z-function z-rust">method</span></span><span class="z-meta z-function z-rust"><span class="z-meta z-function z-parameters z-rust"><span class="z-punctuation z-section z-parameters z-begin z-rust">(</span><span class="z-keyword z-operator z-rust">&</span><span class="z-variable z-parameter z-rust">self</span></span><span class="z-meta z-function z-rust"><span class="z-meta z-function z-parameters z-rust"><span class="z-punctuation z-section z-parameters z-end z-rust">)</span></span></span></span><span class="z-meta z-function z-rust"> <span class="z-meta z-function z-return-type z-rust"><span class="z-punctuation z-separator z-rust">-></span> <span class="z-meta z-generic z-rust"><span class="z-support z-type z-rust">Result</span><span class="z-punctuation z-definition z-generic z-begin z-rust"><</span><span class="z-punctuation z-section z-group z-begin z-rust">(</span><span class="z-punctuation z-section z-group z-end z-rust">)</span>, <span class="z-meta z-path z-rust"><span class="z-storage z-type z-rust"><span class="z-storage z-type z-rust">Self</span><span class="z-punctuation z-accessor z-rust">::</span></span></span>Error<span class="z-punctuation z-definition z-generic z-end z-rust">></span></span></span> </span><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-begin z-rust">{</span>
|
|
</span></span></span></span></span><span class="z-source z-rust"><span class="z-meta z-impl z-rust"><span class="z-meta z-block z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"> <span class="z-support z-type z-rust">Ok</span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-begin z-rust">(</span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-begin z-rust">(</span></span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-end z-rust">)</span></span></span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-end z-rust">)</span></span>
|
|
</span></span></span></span></span><span class="z-source z-rust"><span class="z-meta z-impl z-rust"><span class="z-meta z-block z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"> </span><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-end z-rust">}</span></span></span>
|
|
</span></span></span><span class="z-source z-rust"><span class="z-meta z-impl z-rust"><span class="z-meta z-block z-rust"></span><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-end z-rust">}</span></span></span>
|
|
</span><span class="z-source z-rust">
|
|
</span><span class="z-source z-rust"><span class="z-meta z-struct z-rust"><span class="z-storage z-type z-struct z-rust">struct</span> </span><span class="z-meta z-struct z-rust"><span class="z-entity z-name z-struct z-rust">CanFail</span></span><span class="z-punctuation z-terminator z-rust">;</span>
|
|
</span><span class="z-source z-rust"><span class="z-meta z-impl z-rust"><span class="z-storage z-type z-impl z-rust">impl</span> </span><span class="z-meta z-impl z-rust">UsesAssocErrorType <span class="z-keyword z-other z-rust">for</span></span><span class="z-meta z-impl z-rust"> <span class="z-entity z-name z-impl z-rust">CanFail</span> </span><span class="z-meta z-impl z-rust"><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-begin z-rust">{</span>
|
|
</span></span></span><span class="z-source z-rust"><span class="z-meta z-impl z-rust"><span class="z-meta z-block z-rust"> <span class="z-storage z-type z-type z-rust">type</span> <span class="z-entity z-name z-type z-rust">Error</span> <span class="z-keyword z-operator z-assignment z-rust">=</span> <span class="z-meta z-path z-rust">std<span class="z-punctuation z-accessor z-rust">::</span></span><span class="z-meta z-path z-rust">io<span class="z-punctuation z-accessor z-rust">::</span></span>Error<span class="z-punctuation z-terminator z-rust">;</span>
|
|
</span></span></span><span class="z-source z-rust"><span class="z-meta z-impl z-rust"><span class="z-meta z-block z-rust"> <span class="z-meta z-function z-rust"><span class="z-meta z-function z-rust"><span class="z-storage z-type z-function z-rust">fn</span> </span><span class="z-entity z-name z-function z-rust">method</span></span><span class="z-meta z-function z-rust"><span class="z-meta z-function z-parameters z-rust"><span class="z-punctuation z-section z-parameters z-begin z-rust">(</span><span class="z-keyword z-operator z-rust">&</span><span class="z-variable z-parameter z-rust">self</span></span><span class="z-meta z-function z-rust"><span class="z-meta z-function z-parameters z-rust"><span class="z-punctuation z-section z-parameters z-end z-rust">)</span></span></span></span><span class="z-meta z-function z-rust"> <span class="z-meta z-function z-return-type z-rust"><span class="z-punctuation z-separator z-rust">-></span> <span class="z-meta z-generic z-rust"><span class="z-support z-type z-rust">Result</span><span class="z-punctuation z-definition z-generic z-begin z-rust"><</span><span class="z-punctuation z-section z-group z-begin z-rust">(</span><span class="z-punctuation z-section z-group z-end z-rust">)</span>, <span class="z-meta z-path z-rust"><span class="z-storage z-type z-rust"><span class="z-storage z-type z-rust">Self</span><span class="z-punctuation z-accessor z-rust">::</span></span></span>Error<span class="z-punctuation z-definition z-generic z-end z-rust">></span></span></span> </span><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-begin z-rust">{</span>
|
|
</span></span></span></span></span><span class="z-source z-rust"><span class="z-meta z-impl z-rust"><span class="z-meta z-block z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"> <span class="z-support z-type z-rust">Err</span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-begin z-rust">(</span><span class="z-meta z-path z-rust">std<span class="z-punctuation z-accessor z-rust">::</span></span><span class="z-meta z-path z-rust">io<span class="z-punctuation z-accessor z-rust">::</span></span><span class="z-meta z-path z-rust">Error<span class="z-punctuation z-accessor z-rust">::</span></span>other<span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-begin z-rust">(</span><span class="z-string z-quoted z-double z-rust"><span class="z-punctuation z-definition z-string z-begin z-rust">"</span>something went wrong<span class="z-punctuation z-definition z-string z-end z-rust">"</span></span></span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-end z-rust">)</span></span></span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-end z-rust">)</span></span>
|
|
</span></span></span></span></span><span class="z-source z-rust"><span class="z-meta z-impl z-rust"><span class="z-meta z-block z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"> </span><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-end z-rust">}</span></span></span>
|
|
</span></span></span><span class="z-source z-rust"><span class="z-meta z-impl z-rust"><span class="z-meta z-block z-rust"></span><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-end z-rust">}</span></span></span>
|
|
</span><span class="z-source z-rust">
|
|
</span><span class="z-source z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-function z-rust"><span class="z-storage z-type z-function z-rust">fn</span> </span><span class="z-entity z-name z-function z-rust">main</span></span><span class="z-meta z-function z-rust"><span class="z-meta z-function z-parameters z-rust"><span class="z-punctuation z-section z-parameters z-begin z-rust">(</span></span><span class="z-meta z-function z-rust"><span class="z-meta z-function z-parameters z-rust"><span class="z-punctuation z-section z-parameters z-end z-rust">)</span></span></span></span><span class="z-meta z-function z-rust"> </span><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-begin z-rust">{</span>
|
|
</span></span></span><span class="z-source z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"> CannotFail<span class="z-punctuation z-accessor z-dot z-rust">.</span><span class="z-support z-function z-rust">method</span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-begin z-rust">(</span></span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-end z-rust">)</span></span><span class="z-punctuation z-terminator z-rust">;</span> <span class="z-comment z-line z-double-slash z-rust"><span class="z-punctuation z-definition z-comment z-rust">//</span> No warning
|
|
</span></span></span></span><span class="z-source z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"> CanFail<span class="z-punctuation z-accessor z-dot z-rust">.</span><span class="z-support z-function z-rust">method</span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-begin z-rust">(</span></span><span class="z-meta z-group z-rust"><span class="z-punctuation z-section z-group z-end z-rust">)</span></span><span class="z-punctuation z-terminator z-rust">;</span> <span class="z-comment z-line z-double-slash z-rust"><span class="z-punctuation z-definition z-comment z-rust">//</span> Warning: unused `Result` that must be used
|
|
</span></span></span></span><span class="z-source z-rust"><span class="z-meta z-function z-rust"><span class="z-meta z-block z-rust"></span><span class="z-meta z-block z-rust"><span class="z-punctuation z-section z-block z-end z-rust">}</span></span></span>
|
|
</span></code></pre>
|
|
<h3 id="emit-unwind-tables-even-when-cpanic-abort-is-enabled-on-linux"><a class="anchor" href="#emit-unwind-tables-even-when-cpanic-abort-is-enabled-on-linux" aria-hidden="true"></a>
|
|
Emit unwind tables even when <code>-Cpanic=abort</code> is enabled on linux</h3>
|
|
<p>Backtraces with <code>-Cpanic=abort</code> previously worked in Rust 1.22 but were broken in Rust 1.23, as we stopped emitting unwind tables with <code>-Cpanic=abort</code>. In Rust 1.45 a workaround in the form of <code>-Cforce-unwind-tables=yes</code> was stabilized.</p>
|
|
<p>In Rust 1.92 unwind tables will be emitted by default even when <code>-Cpanic=abort</code> is specified, allowing for backtraces to work properly. If unwind tables are not desired then users should use <code>-Cforce-unwind-tables=no</code> to explicitly disable them being emitted.</p>
|
|
<h3 id="validate-input-to-macro-export"><a class="anchor" href="#validate-input-to-macro-export" aria-hidden="true"></a>
|
|
Validate input to <code>#[macro_export]</code></h3>
|
|
<p>Over the past few releases, many changes were made to the way built-in attributes are processed in the compiler. This should greatly improve the error messages and warnings Rust gives for built-in attributes and especially make these diagnostics more consistent among all of the over 100 built-in attributes.</p>
|
|
<p>To give a small example, in this release specifically, Rust became stricter in checking what arguments are allowed to <code>macro_export</code> by <a href="https://github.com/rust-lang/rust/pull/143857">upgrading that check to a "deny-by-default lint" that will be reported in dependencies</a>.</p>
|
|
<h3 id="stabilized-apis"><a class="anchor" href="#stabilized-apis" aria-hidden="true"></a>
|
|
Stabilized APIs</h3>
|
|
<ul>
|
|
<li><a href="https://doc.rust-lang.org/stable/std/num/struct.NonZero.html#method.div_ceil"><code>NonZero<u{N}>::div_ceil</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.file_as_c_str"><code>Location::file_as_c_str</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/std/sync/struct.RwLockWriteGuard.html#method.downgrade"><code>RwLockWriteGuard::downgrade</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.new_zeroed"><code>Box::new_zeroed</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.new_zeroed_slice"><code>Box::new_zeroed_slice</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.new_zeroed"><code>Rc::new_zeroed</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.new_zeroed_slice"><code>Rc::new_zeroed_slice</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#method.new_zeroed"><code>Arc::new_zeroed</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#method.new_zeroed_slice"><code>Arc::new_zeroed_slice</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/std/collections/btree_map/enum.Entry.html#method.insert_entry"><code>btree_map::Entry::insert_entry</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/std/collections/btree_map/struct.VacantEntry.html#method.insert_entry"><code>btree_map::VacantEntry::insert_entry</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/proc_macro/struct.TokenStream.html#impl-Extend%3CGroup%3E-for-TokenStream"><code>impl Extend<proc_macro::Group> for proc_macro::TokenStream</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/proc_macro/struct.TokenStream.html#impl-Extend%3CLiteral%3E-for-TokenStream"><code>impl Extend<proc_macro::Literal> for proc_macro::TokenStream</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/proc_macro/struct.TokenStream.html#impl-Extend%3CPunct%3E-for-TokenStream"><code>impl Extend<proc_macro::Punct> for proc_macro::TokenStream</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/proc_macro/struct.TokenStream.html#impl-Extend%3CIdent%3E-for-TokenStream"><code>impl Extend<proc_macro::Ident> for proc_macro::TokenStream</code></a></li>
|
|
</ul>
|
|
<p>These previously stable APIs are now stable in const contexts:</p>
|
|
<ul>
|
|
<li><a href="https://doc.rust-lang.org/stable/std/primitive.slice.html#method.rotate_left"><code><[_]>::rotate_left</code></a></li>
|
|
<li><a href="https://doc.rust-lang.org/stable/std/primitive.slice.html#method.rotate_right"><code><[_]>::rotate_right</code></a></li>
|
|
</ul>
|
|
<h3 id="other-changes"><a class="anchor" href="#other-changes" aria-hidden="true"></a>
|
|
Other changes</h3>
|
|
<p>Check out everything that changed in <a href="https://github.com/rust-lang/rust/releases/tag/1.92.0">Rust</a>, <a href="https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html#cargo-192-2025-12-11">Cargo</a>, and <a href="https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-192">Clippy</a>.</p>
|
|
<h2 id="contributors-to-1-92-0"><a class="anchor" href="#contributors-to-1-92-0" aria-hidden="true"></a>
|
|
Contributors to 1.92.0</h2>
|
|
<p>Many people came together to create Rust 1.92.0. We couldn't have done it without all of you. <a href="https://thanks.rust-lang.org/rust/1.92.0/">Thanks!</a></p>
|
|
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<footer class="footer">
|
|
<div class="w-100 mw-none ph3 mw8-m mw9-l center f3">
|
|
<div class="row">
|
|
<div class="four columns mt3 mt0-l" id="get-help">
|
|
<h4>Get help!</h4>
|
|
<ul>
|
|
<li><a href="https://doc.rust-lang.org" target="_blank" rel="noopener">Documentation</a></li>
|
|
<li><a href="mailto:core-team@rust-lang.org">Contact the Rust Team</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="four columns mt3 mt0-l">
|
|
<h4>Terms and policies</h4>
|
|
<ul>
|
|
<li><a href="https://www.rust-lang.org/policies/code-of-conduct">Code of Conduct</a></li>
|
|
<li><a href="https://www.rust-lang.org/policies/licenses">Licenses</a></li>
|
|
<li><a href="https://www.rust-lang.org/policies/media-guide">Logo Policy and Media Guide</a></li>
|
|
<li><a href="https://www.rust-lang.org/policies/security">Security Disclosures</a></li>
|
|
<li><a href="https://www.rust-lang.org/policies">All Policies</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="four columns mt3 mt0-l">
|
|
<h4>Social</h4>
|
|
<div class="flex flex-row flex-wrap">
|
|
<a rel="me" href="https://social.rust-lang.org/@rust" target="_blank"><img src="https://blog.rust-lang.org/images/mastodon.svg" alt="Mastodon"></a>
|
|
<a rel="me" href="https://bsky.app/profile/rust-lang.org" target="_blank"><img src="https://blog.rust-lang.org/images/bluesky.svg" alt="Bluesky"></a>
|
|
<a href="https://www.youtube.com/channel/UCaYhcUwRBNscFNUKTjgPFiA" target="_blank" rel="noopener"><img style="padding-top: 6px; padding-bottom:6px" src="https://blog.rust-lang.org/images/youtube.svg" alt="YouTube"></a>
|
|
<a href="https://discord.gg/rust-lang" target="_blank" rel="noopener"><img src="https://blog.rust-lang.org/images/discord.svg" alt="Discord"></a>
|
|
<a href="https://github.com/rust-lang" target="_blank" rel="noopener"><img src="https://blog.rust-lang.org/images/github.svg" alt="GitHub"></a>
|
|
</div>
|
|
<h4 class="mt4 mb3">RSS</h4>
|
|
<ul>
|
|
<li><a href="https://blog.rust-lang.org/feed.xml">Main Blog</a></li>
|
|
<li><a href="https://blog.rust-lang.org/inside-rust/feed.xml">"Inside Rust" Blog</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="attribution">
|
|
Maintained by the Rust Team. See a typo?
|
|
<a href="https://github.com/rust-lang/blog.rust-lang.org/edit/main/content/Rust-1.92.0.md" target="_blank" rel="noopener">Send a fix here</a>!
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
|
|
</body></html> |