Skip to content

Commit a512d62

Browse files
authored
Merge pull request #4884 from rust-lang/rustup-2026-03-04
Automatic Rustup
2 parents 0500cdc + 12dbc5e commit a512d62

593 files changed

Lines changed: 9457 additions & 9398 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,10 @@ Redddy <rust@redddy.com>
583583
Redddy <rust@redddy.com> <midzy0228@gmail.com>
584584
Redddy <rust@redddy.com> <78539407+reddevilmidzy@users.noreply.github.com>
585585
Rémy Rakic <remy.rakic@gmail.com>
586+
Rémy Rakic <remy.rakic@gmail.com> <remy.rakic@arm.com>
586587
Rémy Rakic <remy.rakic@gmail.com> <remy.rakic+github@gmail.com>
587588
Rémy Rakic <remy.rakic@gmail.com> <remy.rakic+rust@gmail.com>
589+
Rémy Rakic <remy.rakic@gmail.com> <lqd@users.noreply.github.com>
588590
Renato Riccieri Santos Zannon <renato@rrsz.com.br>
589591
Richard Diamond <wichard@vitalitystudios.com> <wichard@hahbee.co>
590592
Ricky Hosfelt <ricky@hosfelt.io>

Cargo.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4121,6 +4121,7 @@ version = "0.0.0"
41214121
dependencies = [
41224122
"cc",
41234123
"libc",
4124+
"shell-words",
41244125
]
41254126

41264127
[[package]]
@@ -5115,6 +5116,12 @@ dependencies = [
51155116
"lazy_static",
51165117
]
51175118

5119+
[[package]]
5120+
name = "shell-words"
5121+
version = "1.1.1"
5122+
source = "registry+https://github.com/rust-lang/crates.io-index"
5123+
checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77"
5124+
51185125
[[package]]
51195126
name = "shlex"
51205127
version = "1.3.0"

RELEASES.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,118 @@
1+
Version 1.94.0 (2026-03-05)
2+
==========================
3+
4+
<a id="1.94.0-Language"></a>
5+
6+
Language
7+
--------
8+
- [Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items](https://github.com/rust-lang/rust/pull/144113)
9+
- [Stabilize additional 29 RISC-V target features including large portions of the RVA22U64 / RVA23U64 profiles](https://github.com/rust-lang/rust/pull/145948)
10+
- [Add warn-by-default `unused_visibilities` lint for visibility on `const _` declarations](https://github.com/rust-lang/rust/pull/147136)
11+
- [Update to Unicode 17](https://github.com/rust-lang/rust/pull/148321)
12+
- [Avoid incorrect lifetime errors for closures](https://github.com/rust-lang/rust/pull/148329)
13+
14+
<a id="1.94.0-Platform-Support"></a>
15+
16+
Platform Support
17+
----------------
18+
19+
- [Add `riscv64im-unknown-none-elf` as a tier 3 target](https://github.com/rust-lang/rust/pull/148790)
20+
21+
Refer to Rust's [platform support page][platform-support-doc]
22+
for more information on Rust's tiered platform support.
23+
24+
[platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html
25+
26+
<a id="1.94.0-Libraries"></a>
27+
28+
Libraries
29+
---------
30+
31+
- [Relax `T: Ord` bound for some `BinaryHeap<T>` methods.](https://github.com/rust-lang/rust/pull/149408)
32+
33+
<a id="1.94.0-Stabilized-APIs"></a>
34+
35+
Stabilized APIs
36+
---------------
37+
38+
- [`<[T]>::array_windows`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.array_windows)
39+
- [`<[T]>::element_offset`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.element_offset)
40+
- [`LazyCell::get`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.get)
41+
- [`LazyCell::get_mut`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.get_mut)
42+
- [`LazyCell::force_mut`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.force_mut)
43+
- [`LazyLock::get`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.get)
44+
- [`LazyLock::get_mut`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.get_mut)
45+
- [`LazyLock::force_mut`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.force_mut)
46+
- [`impl TryFrom<char> for usize`](https://doc.rust-lang.org/stable/std/convert/trait.TryFrom.html#impl-TryFrom%3Cchar%3E-for-usize)
47+
- [`std::iter::Peekable::next_if_map`](https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html#method.next_if_map)
48+
- [`std::iter::Peekable::next_if_map_mut`](https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html#method.next_if_map_mut)
49+
- [x86 `avx512fp16` intrinsics](https://github.com/rust-lang/rust/issues/127213)
50+
(excluding those that depend directly on the unstable `f16` type)
51+
- [AArch64 NEON fp16 intrinsics](https://github.com/rust-lang/rust/issues/136306)
52+
(excluding those that depend directly on the unstable `f16` type)
53+
- [`f32::consts::EULER_GAMMA`](https://doc.rust-lang.org/stable/std/f32/consts/constant.EULER_GAMMA.html)
54+
- [`f64::consts::EULER_GAMMA`](https://doc.rust-lang.org/stable/std/f64/consts/constant.EULER_GAMMA.html)
55+
- [`f32::consts::GOLDEN_RATIO`](https://doc.rust-lang.org/stable/std/f32/consts/constant.GOLDEN_RATIO.html)
56+
- [`f64::consts::GOLDEN_RATIO`](https://doc.rust-lang.org/stable/std/f64/consts/constant.GOLDEN_RATIO.html)
57+
58+
59+
These previously stable APIs are now stable in const contexts:
60+
61+
- [`f32::mul_add`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.mul_add)
62+
- [`f64::mul_add`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.mul_add)
63+
64+
65+
<a id="1.94.0-Cargo"></a>
66+
67+
Cargo
68+
-----
69+
70+
- Stabilize the config include key. The top-level include config key allows loading additional config files, enabling better organization, sharing, and management of Cargo configurations across projects and environments. [docs](https://doc.rust-lang.org/nightly/cargo/reference/config.html#including-extra-configuration-files) [#16284](https://github.com/rust-lang/cargo/pull/16284)
71+
- Stabilize the pubtime field in registry index. This records when a crate version was published and enables time-based dependency resolution in the future. Note that crates.io will gradually backfill existing packages when a new version is published. Not all crates have pubtime yet. [#16369](https://github.com/rust-lang/cargo/pull/16369) [#16372](https://github.com/rust-lang/cargo/pull/16372)
72+
- Cargo now parses [TOML v1.1](https://toml.io/en/v1.1.0) for manifests and configuration files. Note that using these features in Cargo.toml will raise your development MSRV, but the published manifest remains compatible with older parsers. [#16415](https://github.com/rust-lang/cargo/pull/16415)
73+
- [Make `CARGO_BIN_EXE_<crate>` available at runtime ](https://github.com/rust-lang/cargo/pull/16421/)
74+
75+
<a id="1.94.0-Compatibility-Notes"></a>
76+
77+
Compatibility Notes
78+
-------------------
79+
- [Forbid freely casting lifetime bounds of `dyn`-types](https://github.com/rust-lang/rust/pull/136776)
80+
- [Make closure capturing have consistent and correct behaviour around patterns](https://github.com/rust-lang/rust/pull/138961)
81+
Some finer details of how precise closure captures get affected by pattern matching have been changed. In some cases, this can cause a non-move closure that was previously capturing an entire variable by move, to now capture only part of that variable by move, and other parts by borrow. This can cause the borrow checker to complain where it previously didn't, or cause `Drop` to run at a different point in time.
82+
- [Standard library macros are now imported via prelude, not via injected `#[macro_use]`](https://github.com/rust-lang/rust/pull/139493)
83+
This will raise an error if macros of the same name are glob imported.
84+
For example if a crate defines their own `matches` macro and then glob imports that,
85+
it's now ambiguous whether the custom or standard library `matches` is meant and
86+
an explicit import of the name is required to resolve the ambiguity.
87+
One exception is `core::panic` and `std::panic`, if their import is ambiguous
88+
a new warning ([`ambiguous_panic_imports`](https://github.com/rust-lang/rust/issues/147319)) is raised.
89+
This may raise a new warning ([`ambiguous_panic_imports`](https://github.com/rust-lang/rust/issues/147319)) on `#![no_std]` code glob importing the std crate.
90+
Both `core::panic!` and `std::panic!` are then in scope and which is used is ambiguous.
91+
- [Don't strip shebang in expression-context `include!(…)`s](https://github.com/rust-lang/rust/pull/146377)
92+
This can cause previously working includes to no longer compile if they included files which started with a shebang.
93+
- [Ambiguous glob reexports are now also visible cross-crate](https://github.com/rust-lang/rust/pull/147984)
94+
This unifies behavior between local and cross-crate errors on these exports, which may introduce new ambiguity errors.
95+
- [Don't normalize where-clauses before checking well-formedness](https://github.com/rust-lang/rust/pull/148477)
96+
- [Introduce a future compatibility warning on codegen attributes on body-free trait methods](https://github.com/rust-lang/rust/pull/148756)
97+
These attributes currently have no effect in this position.
98+
- [On Windows `std::time::SystemTime::checked_sub_duration` will return `None` for times before the Windows epoch (1/1/1601)](https://github.com/rust-lang/rust/pull/148825)
99+
- [Lifetime identifiers such as `'a` are now NFC normalized](https://github.com/rust-lang/rust/pull/149192).
100+
- [Overhaul filename handling for cross-compiler consistency](https://github.com/rust-lang/rust/pull/149709)
101+
Any paths emitted by compiler now always respect the relative-ness of the paths and `--remap-path-prefix` given originally.
102+
One side-effect of this change is that paths emitted for local crates in Cargo (path dependencies and workspace members) are no longer absolute but relative when emitted as part of a diagnostic in a downstream crate.
103+
104+
<a id="1.94.0-Internal-Changes"></a>
105+
106+
Internal Changes
107+
----------------
108+
109+
These changes do not affect any public interfaces of Rust, but they represent
110+
significant improvements to the performance or internals of rustc and related
111+
tools.
112+
113+
- [Switch to `annotate-snippets` for error emission](https://github.com/rust-lang/rust/pull/150032)
114+
This should preserve mostly the same outputs in rustc error messages.
115+
1116
Version 1.93.1 (2026-02-12)
2117
===========================
3118

compiler/rustc_abi/src/layout.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,9 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
348348
always_sized: bool,
349349
) -> LayoutCalculatorResult<FieldIdx, VariantIdx, F> {
350350
let (present_first, present_second) = {
351-
let mut present_variants = variants
352-
.iter_enumerated()
353-
.filter_map(|(i, v)| if !repr.c() && absent(v) { None } else { Some(i) });
351+
let mut present_variants = variants.iter_enumerated().filter_map(|(i, v)| {
352+
if !repr.inhibit_enum_layout_opt() && absent(v) { None } else { Some(i) }
353+
});
354354
(present_variants.next(), present_variants.next())
355355
};
356356
let present_first = match present_first {

compiler/rustc_ast/src/ast.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,6 +1724,12 @@ pub enum StructRest {
17241724
Rest(Span),
17251725
/// No trailing `..` or expression.
17261726
None,
1727+
/// No trailing `..` or expression, and also, a parse error occurred inside the struct braces.
1728+
///
1729+
/// This struct should be treated similarly to as if it had an `..` in it,
1730+
/// in particular rather than reporting missing fields, because the parse error
1731+
/// makes which fields the struct was intended to have not fully known.
1732+
NoneWithError(ErrorGuaranteed),
17271733
}
17281734

17291735
#[derive(Clone, Encodable, Decodable, Debug, Walkable)]
@@ -3547,6 +3553,19 @@ impl VisibilityKind {
35473553
}
35483554
}
35493555

3556+
#[derive(Clone, Encodable, Decodable, Debug, Walkable)]
3557+
pub struct ImplRestriction {
3558+
pub kind: RestrictionKind,
3559+
pub span: Span,
3560+
pub tokens: Option<LazyAttrTokenStream>,
3561+
}
3562+
3563+
#[derive(Clone, Encodable, Decodable, Debug, Walkable)]
3564+
pub enum RestrictionKind {
3565+
Unrestricted,
3566+
Restricted { path: Box<Path>, id: NodeId, shorthand: bool },
3567+
}
3568+
35503569
/// Field definition in a struct, variant or union.
35513570
///
35523571
/// E.g., `bar: usize` as in `struct Foo { bar: usize }`.
@@ -3746,6 +3765,7 @@ pub struct Trait {
37463765
pub constness: Const,
37473766
pub safety: Safety,
37483767
pub is_auto: IsAuto,
3768+
pub impl_restriction: ImplRestriction,
37493769
pub ident: Ident,
37503770
pub generics: Generics,
37513771
#[visitable(extra = BoundKind::SuperTraits)]

compiler/rustc_ast/src/ast_traits.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use std::marker::PhantomData;
88
use crate::tokenstream::LazyAttrTokenStream;
99
use crate::{
1010
Arm, AssocItem, AttrItem, AttrKind, AttrVec, Attribute, Block, Crate, Expr, ExprField,
11-
FieldDef, ForeignItem, GenericParam, Item, NodeId, Param, Pat, PatField, Path, Stmt, StmtKind,
12-
Ty, Variant, Visibility, WherePredicate,
11+
FieldDef, ForeignItem, GenericParam, ImplRestriction, Item, NodeId, Param, Pat, PatField, Path,
12+
Stmt, StmtKind, Ty, Variant, Visibility, WherePredicate,
1313
};
1414

1515
/// A trait for AST nodes having an ID.
@@ -97,7 +97,19 @@ macro_rules! impl_has_tokens_none {
9797
};
9898
}
9999

100-
impl_has_tokens!(AssocItem, AttrItem, Block, Expr, ForeignItem, Item, Pat, Path, Ty, Visibility);
100+
impl_has_tokens!(
101+
AssocItem,
102+
AttrItem,
103+
Block,
104+
Expr,
105+
ForeignItem,
106+
Item,
107+
Pat,
108+
Path,
109+
Ty,
110+
Visibility,
111+
ImplRestriction
112+
);
101113
impl_has_tokens_none!(
102114
Arm,
103115
ExprField,
@@ -242,7 +254,7 @@ impl_has_attrs!(
242254
Variant,
243255
WherePredicate,
244256
);
245-
impl_has_attrs_none!(Attribute, AttrItem, Block, Pat, Path, Ty, Visibility);
257+
impl_has_attrs_none!(Attribute, AttrItem, Block, Pat, Path, Ty, Visibility, ImplRestriction);
246258

247259
impl<T: HasAttrs> HasAttrs for Box<T> {
248260
const SUPPORTS_CUSTOM_INNER_ATTRS: bool = T::SUPPORTS_CUSTOM_INNER_ATTRS;

compiler/rustc_ast/src/visit.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ macro_rules! common_visitor_and_walkers {
467467
RangeEnd,
468468
RangeSyntax,
469469
Recovered,
470+
RestrictionKind,
470471
Safety,
471472
StaticItem,
472473
StrLit,
@@ -595,6 +596,7 @@ macro_rules! common_visitor_and_walkers {
595596
fn visit_poly_trait_ref(PolyTraitRef);
596597
fn visit_precise_capturing_arg(PreciseCapturingArg);
597598
fn visit_qself(QSelf);
599+
fn visit_impl_restriction(ImplRestriction);
598600
fn visit_trait_ref(TraitRef);
599601
fn visit_ty_pat(TyPat);
600602
fn visit_ty(Ty);
@@ -1117,6 +1119,7 @@ macro_rules! common_visitor_and_walkers {
11171119
pub fn walk_poly_trait_ref(PolyTraitRef);
11181120
pub fn walk_precise_capturing_arg(PreciseCapturingArg);
11191121
pub fn walk_qself(QSelf);
1122+
pub fn walk_impl_restriction(ImplRestriction);
11201123
pub fn walk_trait_ref(TraitRef);
11211124
pub fn walk_ty_pat(TyPat);
11221125
pub fn walk_ty(Ty);

0 commit comments

Comments
 (0)