Skip to content

Commit bcea445

Browse files
committed
Auto merge of #154211 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum
[stable] 1.94.1 release This backports: * [STABLE] library: wasm32-wasip1-threads has functional pthreads #153634 * Move freeze_* methods to OpenOptionsExt2 #153491 * [Clippy] Fix ICE in match_same_arms rust-lang/rust-clippy#16685 Cargo: * [stable 1.94] Fix symlink_and_directory when running in a long target dir name (rust-lang/cargo#16777) * Fix symlink_and_directory when running in a long target dir name (rust-lang/cargo#16775) * [stable 1.94] Update tar to 0.4.45 (rust-lang/cargo#16769) * test: Remove unused docker ip_address (rust-lang/cargo#16636) * Increase cache_lock test timeout (rust-lang/cargo#16545) * chore: Updated compiler errors for Rust 1.93 (rust-lang/cargo#16543) * test(build-std): Update error message (rust-lang/cargo#16658) * fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang/cargo#16536) * fix(script): surpress `unused_features` lint for embedded (rust-lang/cargo#16714) * test(git): Mark a test as non-deterministic (rust-lang/cargo#16706) * test(replace): Mark a test as non-deterministic (rust-lang/cargo#16700)
2 parents 4a4ef49 + ff8efbd commit bcea445

File tree

10 files changed

+102
-24
lines changed

10 files changed

+102
-24
lines changed

RELEASES.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
Version 1.94.1 (2026-03-26)
2+
===========================
3+
4+
<a id="1.94.1"></a>
5+
6+
* [Fix `std::thread::spawn` on wasm32-wasip1-threads](https://github.com/rust-lang/rust/pull/153634)
7+
* [Remove new methods added to `std::os::windows::fs::OpenOptionsExt`](https://github.com/rust-lang/rust/pull/153491)
8+
The new methods were unstable, but the trait itself is not sealed and so
9+
cannot be extended with non-default methods.
10+
* [[Clippy] Fix ICE in `match_same_arms`](https://github.com/rust-lang/rust-clippy/pull/16685)
11+
* [[Cargo] Update tar to 0.4.45](https://github.com/rust-lang/cargo/pull/16769)
12+
This resolves CVE-2026-33055 and CVE-2026-33056. Users of crates.io are not affected.
13+
See [blog](https://blog.rust-lang.org/2026/03/21/cve-2026-33056/) for more details.
14+
115
Version 1.94.0 (2026-03-05)
216
==========================
317

library/std/src/os/windows/fs.rs

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ impl FileExt for fs::File {
138138
}
139139

140140
/// Windows-specific extensions to [`fs::OpenOptions`].
141+
// WARNING: This trait is not sealed. DON'T add any new methods!
142+
// Add them to OpenOptionsExt2 instead.
141143
#[stable(feature = "open_options_ext", since = "1.10.0")]
142144
pub trait OpenOptionsExt {
143145
/// Overrides the `dwDesiredAccess` argument to the call to [`CreateFile`]
@@ -305,18 +307,6 @@ pub trait OpenOptionsExt {
305307
/// https://docs.microsoft.com/en-us/windows/win32/api/winnt/ne-winnt-security_impersonation_level
306308
#[stable(feature = "open_options_ext", since = "1.10.0")]
307309
fn security_qos_flags(&mut self, flags: u32) -> &mut Self;
308-
309-
/// If set to `true`, prevent the "last access time" of the file from being changed.
310-
///
311-
/// Default to `false`.
312-
#[unstable(feature = "windows_freeze_file_times", issue = "149715")]
313-
fn freeze_last_access_time(&mut self, freeze: bool) -> &mut Self;
314-
315-
/// If set to `true`, prevent the "last write time" of the file from being changed.
316-
///
317-
/// Default to `false`.
318-
#[unstable(feature = "windows_freeze_file_times", issue = "149715")]
319-
fn freeze_last_write_time(&mut self, freeze: bool) -> &mut Self;
320310
}
321311

322312
#[stable(feature = "open_options_ext", since = "1.10.0")]
@@ -345,7 +335,28 @@ impl OpenOptionsExt for OpenOptions {
345335
self.as_inner_mut().security_qos_flags(flags);
346336
self
347337
}
338+
}
339+
340+
#[unstable(feature = "windows_freeze_file_times", issue = "149715")]
341+
pub trait OpenOptionsExt2: Sealed {
342+
/// If set to `true`, prevent the "last access time" of the file from being changed.
343+
///
344+
/// Default to `false`.
345+
#[unstable(feature = "windows_freeze_file_times", issue = "149715")]
346+
fn freeze_last_access_time(&mut self, freeze: bool) -> &mut Self;
347+
348+
/// If set to `true`, prevent the "last write time" of the file from being changed.
349+
///
350+
/// Default to `false`.
351+
#[unstable(feature = "windows_freeze_file_times", issue = "149715")]
352+
fn freeze_last_write_time(&mut self, freeze: bool) -> &mut Self;
353+
}
354+
355+
#[unstable(feature = "sealed", issue = "none")]
356+
impl Sealed for OpenOptions {}
348357

358+
#[unstable(feature = "windows_freeze_file_times", issue = "149715")]
359+
impl OpenOptionsExt2 for OpenOptions {
349360
fn freeze_last_access_time(&mut self, freeze: bool) -> &mut Self {
350361
self.as_inner_mut().freeze_last_access_time(freeze);
351362
self

library/std/src/sys/thread/unix.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ impl Thread {
4949
// WASI does not support threading via pthreads. While wasi-libc provides
5050
// pthread stubs, pthread_create returns EAGAIN, which causes confusing
5151
// errors. We return UNSUPPORTED_PLATFORM directly instead.
52-
if cfg!(target_os = "wasi") {
52+
53+
// NOTE: exempt `wasm32-wasip1-threads` from this check as `emnapi` has a working pthread
54+
// implementation. See <https://github.com/rust-lang/rust/issues/153475>.
55+
if cfg!(all(target_os = "wasi", not(all(target_env = "p1", target_feature = "atomics")))) {
5356
return Err(io::Error::UNSUPPORTED_PLATFORM);
5457
}
5558

src/tools/clippy/clippy_lints/src/matches/match_same_arms.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_hir::def_id::DefId;
1212
use rustc_hir::{Arm, Expr, HirId, HirIdMap, HirIdMapEntry, HirIdSet, Pat, PatExpr, PatExprKind, PatKind, RangeEnd};
1313
use rustc_lint::builtin::NON_EXHAUSTIVE_OMITTED_PATTERNS;
1414
use rustc_lint::{LateContext, LintContext};
15-
use rustc_middle::ty;
15+
use rustc_middle::ty::{self, TypeckResults};
1616
use rustc_span::{ByteSymbol, ErrorGuaranteed, Span, Symbol};
1717

1818
use super::MATCH_SAME_ARMS;
@@ -61,7 +61,10 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, arms: &'tcx [Arm<'_>]) {
6161

6262
let check_eq_with_pat = |expr_a: &Expr<'_>, expr_b: &Expr<'_>| {
6363
let mut local_map: HirIdMap<HirId> = HirIdMap::default();
64-
let eq_fallback = |a: &Expr<'_>, b: &Expr<'_>| {
64+
let eq_fallback = |a_typeck_results: &TypeckResults<'tcx>,
65+
a: &Expr<'_>,
66+
b_typeck_results: &TypeckResults<'tcx>,
67+
b: &Expr<'_>| {
6568
if let Some(a_id) = a.res_local_id()
6669
&& let Some(b_id) = b.res_local_id()
6770
&& let entry = match local_map.entry(a_id) {
@@ -71,7 +74,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, arms: &'tcx [Arm<'_>]) {
7174
}
7275
// the names technically don't have to match; this makes the lint more conservative
7376
&& cx.tcx.hir_name(a_id) == cx.tcx.hir_name(b_id)
74-
&& cx.typeck_results().expr_ty(a) == cx.typeck_results().expr_ty(b)
77+
&& a_typeck_results.expr_ty(a) == b_typeck_results.expr_ty(b)
7578
&& pat_contains_local(lhs.pat, a_id)
7679
&& pat_contains_local(rhs.pat, b_id)
7780
{

src/tools/clippy/clippy_lints/src/methods/filter_map.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use rustc_hir as hir;
99
use rustc_hir::def::Res;
1010
use rustc_hir::{Closure, Expr, ExprKind, PatKind, PathSegment, QPath, UnOp};
1111
use rustc_lint::LateContext;
12+
use rustc_middle::ty::TypeckResults;
1213
use rustc_middle::ty::adjustment::Adjust;
1314
use rustc_span::Span;
1415
use rustc_span::symbol::{Ident, Symbol};
@@ -136,15 +137,17 @@ impl<'tcx> OffendingFilterExpr<'tcx> {
136137
// .map(|y| y[.acceptable_method()].unwrap())
137138
&& let simple_equal = (receiver.res_local_id() == Some(filter_param_id)
138139
&& map_arg_peeled.res_local_id() == Some(map_param_id))
139-
&& let eq_fallback = (|a: &Expr<'_>, b: &Expr<'_>| {
140+
&& let eq_fallback =
141+
(|a_typeck_results: &TypeckResults<'tcx>, a: &Expr<'_>,
142+
b_typeck_results: &TypeckResults<'tcx>, b: &Expr<'_>| {
140143
// in `filter(|x| ..)`, replace `*x` with `x`
141144
let a_path = if !is_filter_param_ref
142145
&& let ExprKind::Unary(UnOp::Deref, expr_path) = a.kind
143146
{ expr_path } else { a };
144147
// let the filter closure arg and the map closure arg be equal
145148
a_path.res_local_id() == Some(filter_param_id)
146149
&& b.res_local_id() == Some(map_param_id)
147-
&& cx.typeck_results().expr_ty_adjusted(a) == cx.typeck_results().expr_ty_adjusted(b)
150+
&& a_typeck_results.expr_ty_adjusted(a) == b_typeck_results.expr_ty_adjusted(b)
148151
})
149152
&& (simple_equal
150153
|| SpanlessEq::new(cx).expr_fallback(eq_fallback).eq_expr(receiver, map_arg_peeled))

src/tools/clippy/clippy_utils/src/hir_utils.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ use std::slice;
2626

2727
/// Callback that is called when two expressions are not equal in the sense of `SpanlessEq`, but
2828
/// other conditions would make them equal.
29-
type SpanlessEqCallback<'a> = dyn FnMut(&Expr<'_>, &Expr<'_>) -> bool + 'a;
29+
type SpanlessEqCallback<'a, 'tcx> =
30+
dyn FnMut(&TypeckResults<'tcx>, &Expr<'_>, &TypeckResults<'tcx>, &Expr<'_>) -> bool + 'a;
3031

3132
/// Determines how paths are hashed and compared for equality.
3233
#[derive(Copy, Clone, Debug, Default)]
@@ -59,7 +60,7 @@ pub struct SpanlessEq<'a, 'tcx> {
5960
cx: &'a LateContext<'tcx>,
6061
maybe_typeck_results: Option<(&'tcx TypeckResults<'tcx>, &'tcx TypeckResults<'tcx>)>,
6162
allow_side_effects: bool,
62-
expr_fallback: Option<Box<SpanlessEqCallback<'a>>>,
63+
expr_fallback: Option<Box<SpanlessEqCallback<'a, 'tcx>>>,
6364
path_check: PathCheck,
6465
}
6566

@@ -94,7 +95,10 @@ impl<'a, 'tcx> SpanlessEq<'a, 'tcx> {
9495
}
9596

9697
#[must_use]
97-
pub fn expr_fallback(self, expr_fallback: impl FnMut(&Expr<'_>, &Expr<'_>) -> bool + 'a) -> Self {
98+
pub fn expr_fallback(
99+
self,
100+
expr_fallback: impl FnMut(&TypeckResults<'tcx>, &Expr<'_>, &TypeckResults<'tcx>, &Expr<'_>) -> bool + 'a,
101+
) -> Self {
98102
Self {
99103
expr_fallback: Some(Box::new(expr_fallback)),
100104
..self
@@ -639,7 +643,15 @@ impl HirEqInterExpr<'_, '_, '_> {
639643
) => false,
640644
};
641645
(is_eq && (!self.should_ignore(left) || !self.should_ignore(right)))
642-
|| self.inner.expr_fallback.as_mut().is_some_and(|f| f(left, right))
646+
|| self
647+
.inner
648+
.maybe_typeck_results
649+
.is_some_and(|(left_typeck_results, right_typeck_results)| {
650+
self.inner
651+
.expr_fallback
652+
.as_mut()
653+
.is_some_and(|f| f(left_typeck_results, left, right_typeck_results, right))
654+
})
643655
}
644656

645657
fn eq_exprs(&mut self, left: &[Expr<'_>], right: &[Expr<'_>]) -> bool {

src/tools/clippy/tests/ui/match_same_arms.fixed

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,19 @@ fn main() {
140140
_ => false,
141141
};
142142
}
143+
144+
fn issue16678() {
145+
// ICE in Rust 1.94.0
146+
match true {
147+
true => {
148+
fn wrapper(_arg: ()) {
149+
_arg;
150+
}
151+
},
152+
false => {
153+
fn wrapper(_arg: ()) {
154+
_arg;
155+
}
156+
},
157+
}
158+
}

src/tools/clippy/tests/ui/match_same_arms.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,19 @@ fn main() {
149149
_ => false,
150150
};
151151
}
152+
153+
fn issue16678() {
154+
// ICE in Rust 1.94.0
155+
match true {
156+
true => {
157+
fn wrapper(_arg: ()) {
158+
_arg;
159+
}
160+
},
161+
false => {
162+
fn wrapper(_arg: ()) {
163+
_arg;
164+
}
165+
},
166+
}
167+
}

src/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.94.0
1+
1.94.1

0 commit comments

Comments
 (0)