Skip to content

Commit 605f49b

Browse files
committed
Auto merge of rust-lang#152506 - Urgau:rollup-MlGAszj, r=Urgau
Rollup of 7 pull requests Successful merges: - rust-lang#152505 (Sync relnotes for stable 1.93.1) - rust-lang#137487 (Stabilize `assert_matches`) - rust-lang#152281 (borrowck: suggest `&mut *x` for pattern reborrows) - rust-lang#151142 (Support ADT types in type info reflection) - rust-lang#152477 (rustc-dev-guide subtree update) - rust-lang#152488 (allow `deprecated(since = "CURRENT_RUSTC_VERSION")`) - rust-lang#152491 (Remove unused `fluent-syntax` dependency from tidy)
2 parents 5fdff78 + 452e85a commit 605f49b

File tree

122 files changed

+1178
-875
lines changed

Some content is hidden

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

122 files changed

+1178
-875
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5564,7 +5564,6 @@ dependencies = [
55645564
"build_helper",
55655565
"cargo_metadata 0.21.0",
55665566
"clap",
5567-
"fluent-syntax",
55685567
"globset",
55695568
"ignore",
55705569
"miropt-test-tools",

RELEASES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
Version 1.93.1 (2026-02-12)
2+
===========================
3+
4+
<a id="1.93.1"></a>
5+
6+
- [Don't try to recover keyword as non-keyword identifier](https://github.com/rust-lang/rust/pull/150590), fixing an ICE that especially [affected rustfmt](https://github.com/rust-lang/rustfmt/issues/6739).
7+
- [Fix `clippy::panicking_unwrap` false-positive on field access with implicit deref](https://github.com/rust-lang/rust-clippy/pull/16196).
8+
- [Revert "Update wasm-related dependencies in CI"](https://github.com/rust-lang/rust/pull/152259), fixing file descriptor leaks on the `wasm32-wasip2` target.
9+
110
Version 1.93.0 (2026-01-22)
211
==========================
312

compiler/rustc_abi/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// tidy-alphabetical-start
2+
#![cfg_attr(all(feature = "nightly", bootstrap), feature(assert_matches))]
23
#![cfg_attr(feature = "nightly", allow(internal_features))]
3-
#![cfg_attr(feature = "nightly", feature(assert_matches))]
44
#![cfg_attr(feature = "nightly", feature(rustc_attrs))]
55
#![cfg_attr(feature = "nightly", feature(step_trait))]
66
// tidy-alphabetical-end

compiler/rustc_attr_parsing/src/attributes/deprecation.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use rustc_hir::attrs::{DeprecatedSince, Deprecation};
2+
use rustc_hir::{RustcVersion, VERSION_PLACEHOLDER};
23

34
use super::prelude::*;
45
use super::util::parse_version;
@@ -143,6 +144,8 @@ impl<S: Stage> SingleAttributeParser<S> for DeprecationParser {
143144
DeprecatedSince::Future
144145
} else if !is_rustc {
145146
DeprecatedSince::NonStandard(since)
147+
} else if since.as_str() == VERSION_PLACEHOLDER {
148+
DeprecatedSince::RustcVersion(RustcVersion::CURRENT)
146149
} else if let Some(version) = parse_version(since) {
147150
DeprecatedSince::RustcVersion(version)
148151
} else {

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

Lines changed: 65 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -354,14 +354,71 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
354354
self.infcx.tcx.sess.source_map().span_to_snippet(source_info.span)
355355
{
356356
if snippet.starts_with("&mut ") {
357-
// We don't have access to the HIR to get accurate spans, but we can
358-
// give a best effort structured suggestion.
359-
err.span_suggestion_verbose(
360-
source_info.span.with_hi(source_info.span.lo() + BytePos(5)),
361-
"if there is only one mutable reborrow, remove the `&mut`",
362-
"",
363-
Applicability::MaybeIncorrect,
364-
);
357+
// In calls, `&mut &mut T` may be deref-coerced to `&mut T`, and
358+
// removing the extra `&mut` is the most direct suggestion. But for
359+
// pattern-matching expressions (`match`, `if let`, `while let`), that
360+
// can easily turn into a move, so prefer suggesting an explicit
361+
// reborrow via `&mut *x` instead.
362+
let mut in_pat_scrutinee = false;
363+
let mut is_deref_coerced = false;
364+
if let Some(expr) = self.find_expr(source_info.span) {
365+
let tcx = self.infcx.tcx;
366+
let span = expr.span.source_callsite();
367+
for (_, node) in tcx.hir_parent_iter(expr.hir_id) {
368+
if let Node::Expr(parent_expr) = node {
369+
match parent_expr.kind {
370+
ExprKind::Match(scrutinee, ..)
371+
if scrutinee
372+
.span
373+
.source_callsite()
374+
.contains(span) =>
375+
{
376+
in_pat_scrutinee = true;
377+
break;
378+
}
379+
ExprKind::Let(let_expr)
380+
if let_expr
381+
.init
382+
.span
383+
.source_callsite()
384+
.contains(span) =>
385+
{
386+
in_pat_scrutinee = true;
387+
break;
388+
}
389+
_ => {}
390+
}
391+
}
392+
}
393+
394+
let typeck = tcx.typeck(expr.hir_id.owner.def_id);
395+
is_deref_coerced =
396+
typeck.expr_adjustments(expr).iter().any(|adj| {
397+
matches!(adj.kind, ty::adjustment::Adjust::Deref(_))
398+
});
399+
}
400+
401+
if in_pat_scrutinee {
402+
// Best-effort structured suggestion: insert `*` after `&mut `.
403+
err.span_suggestion_verbose(
404+
source_info
405+
.span
406+
.with_lo(source_info.span.lo() + BytePos(5))
407+
.shrink_to_lo(),
408+
"to reborrow the mutable reference, add `*`",
409+
"*",
410+
Applicability::MaybeIncorrect,
411+
);
412+
} else if is_deref_coerced {
413+
// We don't have access to the HIR to get accurate spans, but we
414+
// can give a best effort structured suggestion.
415+
err.span_suggestion_verbose(
416+
source_info.span.with_hi(source_info.span.lo() + BytePos(5)),
417+
"if there is only one mutable reborrow, remove the `&mut`",
418+
"",
419+
Applicability::MaybeIncorrect,
420+
);
421+
}
365422
} else {
366423
// This can occur with things like `(&mut self).foo()`.
367424
err.span_help(source_info.span, "try removing `&mut` here");

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
// tidy-alphabetical-start
44
#![allow(internal_features)]
5-
#![feature(assert_matches)]
5+
#![cfg_attr(bootstrap, feature(assert_matches))]
66
#![feature(box_patterns)]
77
#![feature(default_field_values)]
88
#![feature(file_buffered)]

compiler/rustc_builtin_macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
// tidy-alphabetical-start
55
#![allow(internal_features)]
6-
#![feature(assert_matches)]
6+
#![cfg_attr(bootstrap, feature(assert_matches))]
77
#![feature(box_patterns)]
88
#![feature(decl_macro)]
99
#![feature(if_let_guard)]

compiler/rustc_codegen_llvm/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! This API is completely unstable and subject to change.
66
77
// tidy-alphabetical-start
8-
#![feature(assert_matches)]
8+
#![cfg_attr(bootstrap, feature(assert_matches))]
99
#![feature(extern_types)]
1010
#![feature(file_buffered)]
1111
#![feature(if_let_guard)]

compiler/rustc_codegen_ssa/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// tidy-alphabetical-start
2-
#![feature(assert_matches)]
2+
#![cfg_attr(bootstrap, feature(assert_matches))]
33
#![feature(box_patterns)]
44
#![feature(file_buffered)]
55
#![feature(if_let_guard)]

0 commit comments

Comments
 (0)