Skip to content

Commit 1b7d722

Browse files
committed
Auto merge of #153331 - JonathanBrouwer:rollup-hr9XbEa, r=JonathanBrouwer
Rollup of 12 pull requests Successful merges: - #152941 (prefer actual ABI-controling fields over target.abi when making ABI decisions) - #153227 (Don’t report missing fields in struct exprs with syntax errors.) - #153265 (Clarified doc comments + added tests confirming current behavior for intersperse/intersperse_with) - #152966 (Migrate 11 tests from tests/ui/issues to specific directories) - #153003 (rustdoc: make `--emit` and `--out-dir` mimic rustc) - #153034 (Remove unhelpful hint from trivial bound errors) - #153152 (Migration of LintDiagnostic - part 5) - #153177 (disable the ptr_fragment_in_final test on s390x) - #153221 (Add release notes for 1.94.0) - #153279 (feat: Provide an '.item_kind()' method on ItemEnum) - #153297 (Update the name of the Hermit operating system) - #153309 (Cleanup of c-variadic link test)
2 parents d3877ec + cec85ce commit 1b7d722

File tree

102 files changed

+1537
-1007
lines changed

Some content is hidden

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

102 files changed

+1537
-1007
lines changed

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_ast/src/ast.rs

Lines changed: 6 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)]

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
340340
self.arena.alloc_from_iter(fields.iter().map(|&ident| self.lower_ident(ident))),
341341
),
342342
ExprKind::Struct(se) => {
343-
let rest = match &se.rest {
344-
StructRest::Base(e) => hir::StructTailExpr::Base(self.lower_expr(e)),
343+
let rest = match se.rest {
344+
StructRest::Base(ref e) => hir::StructTailExpr::Base(self.lower_expr(e)),
345345
StructRest::Rest(sp) => {
346-
hir::StructTailExpr::DefaultFields(self.lower_span(*sp))
346+
hir::StructTailExpr::DefaultFields(self.lower_span(sp))
347347
}
348348
StructRest::None => hir::StructTailExpr::None,
349+
StructRest::NoneWithError(guar) => hir::StructTailExpr::NoneWithError(guar),
349350
};
350351
hir::ExprKind::Struct(
351352
self.arena.alloc(self.lower_qpath(
@@ -1435,7 +1436,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
14351436
Some(self.lower_span(e.span))
14361437
}
14371438
StructRest::Rest(span) => Some(self.lower_span(*span)),
1438-
StructRest::None => None,
1439+
StructRest::None | StructRest::NoneWithError(_) => None,
14391440
};
14401441
let struct_pat = hir::PatKind::Struct(qpath, field_pats, fields_omitted);
14411442
return self.pat_without_dbm(lhs.span, struct_pat);

compiler/rustc_ast_pretty/src/pprust/state/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl<'a> State<'a> {
162162
self.word("{");
163163
let has_rest = match rest {
164164
ast::StructRest::Base(_) | ast::StructRest::Rest(_) => true,
165-
ast::StructRest::None => false,
165+
ast::StructRest::None | ast::StructRest::NoneWithError(_) => false,
166166
};
167167
if fields.is_empty() && !has_rest {
168168
self.word("}");

compiler/rustc_codegen_llvm/src/va_arg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_codegen_ssa::traits::{
88
use rustc_middle::bug;
99
use rustc_middle::ty::Ty;
1010
use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, TyAndLayout};
11-
use rustc_target::spec::{Abi, Arch, Env};
11+
use rustc_target::spec::{Arch, Env, RustcAbi};
1212

1313
use crate::builder::Builder;
1414
use crate::llvm::{Type, Value};
@@ -272,7 +272,7 @@ fn emit_powerpc_va_arg<'ll, 'tcx>(
272272

273273
// Rust does not currently support any powerpc softfloat targets.
274274
let target = &bx.cx.tcx.sess.target;
275-
let is_soft_float_abi = target.abi == Abi::SoftFloat;
275+
let is_soft_float_abi = target.rustc_abi == Some(RustcAbi::Softfloat);
276276
assert!(!is_soft_float_abi);
277277

278278
// All instances of VaArgSafe are passed directly.
@@ -1077,7 +1077,7 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
10771077
AllowHigherAlign::Yes,
10781078
ForceRightAdjust::Yes,
10791079
),
1080-
Arch::RiscV32 if target.abi == Abi::Ilp32e => {
1080+
Arch::RiscV32 if target.llvm_abiname == "ilp32e" => {
10811081
// FIXME: clang manually adjusts the alignment for this ABI. It notes:
10821082
//
10831083
// > To be compatible with GCC's behaviors, we force arguments with

compiler/rustc_hir/src/hir.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2662,7 +2662,9 @@ impl Expr<'_> {
26622662
ExprKind::Struct(_, fields, init) => {
26632663
let init_side_effects = match init {
26642664
StructTailExpr::Base(init) => init.can_have_side_effects(),
2665-
StructTailExpr::DefaultFields(_) | StructTailExpr::None => false,
2665+
StructTailExpr::DefaultFields(_)
2666+
| StructTailExpr::None
2667+
| StructTailExpr::NoneWithError(_) => false,
26662668
};
26672669
fields.iter().map(|field| field.expr).any(|e| e.can_have_side_effects())
26682670
|| init_side_effects
@@ -2954,6 +2956,12 @@ pub enum StructTailExpr<'hir> {
29542956
/// fields' default values will be used to populate any fields not explicitly mentioned:
29552957
/// `Foo { .. }`.
29562958
DefaultFields(Span),
2959+
/// No trailing `..` was written, and also, a parse error occurred inside the struct braces.
2960+
///
2961+
/// This struct should be treated similarly to as if it had an `..` in it,
2962+
/// in particular rather than reporting missing fields, because the parse error
2963+
/// makes which fields the struct was intended to have not fully known.
2964+
NoneWithError(ErrorGuaranteed),
29572965
}
29582966

29592967
/// Represents an optionally `Self`-qualified value/type path or associated extension.

compiler/rustc_hir/src/intravisit.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,9 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr<'v>)
830830
walk_list!(visitor, visit_expr_field, fields);
831831
match optional_base {
832832
StructTailExpr::Base(base) => try_visit!(visitor.visit_expr(base)),
833-
StructTailExpr::None | StructTailExpr::DefaultFields(_) => {}
833+
StructTailExpr::None
834+
| StructTailExpr::NoneWithError(_)
835+
| StructTailExpr::DefaultFields(_) => {}
834836
}
835837
}
836838
ExprKind::Tup(subexpressions) => {

compiler/rustc_hir_analysis/src/lib.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ use rustc_abi::{CVariadicStatus, ExternAbi};
8888
use rustc_hir as hir;
8989
use rustc_hir::def::DefKind;
9090
use rustc_hir::lints::DelayedLint;
91+
use rustc_lint::DecorateAttrLint;
9192
use rustc_middle::mir::interpret::GlobalId;
9293
use rustc_middle::query::Providers;
9394
use rustc_middle::ty::{Const, Ty, TyCtxt};
@@ -148,20 +149,17 @@ pub fn provide(providers: &mut Providers) {
148149
};
149150
}
150151

151-
fn emit_delayed_lint(lint: &DelayedLint, tcx: TyCtxt<'_>) {
152+
pub fn emit_delayed_lint(lint: &DelayedLint, tcx: TyCtxt<'_>) {
152153
match lint {
153154
DelayedLint::AttributeParsing(attribute_lint) => {
154-
tcx.node_span_lint(
155+
tcx.emit_node_span_lint(
155156
attribute_lint.lint_id.lint,
156157
attribute_lint.id,
157158
attribute_lint.span,
158-
|diag| {
159-
rustc_lint::decorate_attribute_lint(
160-
tcx.sess,
161-
Some(tcx),
162-
&attribute_lint.kind,
163-
diag,
164-
);
159+
DecorateAttrLint {
160+
sess: tcx.sess,
161+
tcx: Some(tcx),
162+
diagnostic: &attribute_lint.kind,
165163
},
166164
);
167165
}

compiler/rustc_hir_pretty/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,7 @@ impl<'a> State<'a> {
13141314
self.end(ib);
13151315
}
13161316
hir::StructTailExpr::None => {}
1317+
hir::StructTailExpr::NoneWithError(_) => {}
13171318
}
13181319
self.space();
13191320
self.word("}");

0 commit comments

Comments
 (0)