Skip to content

Commit a4777e4

Browse files
authored
Merge pull request #4758 from rust-lang/rustup-2025-12-11
Automatic Rustup
2 parents 0830b84 + a9f0a49 commit a4777e4

File tree

1,051 files changed

+17497
-10680
lines changed

Some content is hidden

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

1,051 files changed

+17497
-10680
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: ["rust-lang.org/funding"]

.github/workflows/ghcr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ jobs:
5555
images=(
5656
# Mirrored because used by the tidy job, which doesn't cache Docker images
5757
"ubuntu:22.04"
58+
# Mirrored because used by x86-64-gnu-miri
59+
"ubuntu:24.04"
5860
# Mirrored because used by all linux CI jobs, including tidy
5961
"moby/buildkit:buildx-stable-1"
6062
# Mirrored because used when CI is running inside a Docker container

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Ben Sago <ogham@users.noreply.github.com> <ogham@bsago.me>
8383
Ben Striegel <ben.striegel@gmail.com>
8484
Benjamin Jackman <ben@jackman.biz>
8585
Benoît Cortier <benoit.cortier@fried-world.eu>
86+
binarycat <binarycat@envs.net> lolbinarycat <dogedoge61+github@gmail.com> <dogedoge61@gmail.com>
8687
Bheesham Persaud <bheesham123@hotmail.com> Bheesham Persaud <bheesham.persaud@live.ca>
8788
bjorn3 <17426603+bjorn3@users.noreply.github.com> <bjorn3@users.noreply.github.com>
8889
bjorn3 <17426603+bjorn3@users.noreply.github.com> <bjorn3_gh@protonmail.com>

Cargo.lock

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
621621

622622
[[package]]
623623
name = "clippy"
624-
version = "0.1.93"
624+
version = "0.1.94"
625625
dependencies = [
626626
"anstream",
627627
"askama",
@@ -648,7 +648,7 @@ dependencies = [
648648

649649
[[package]]
650650
name = "clippy_config"
651-
version = "0.1.93"
651+
version = "0.1.94"
652652
dependencies = [
653653
"clippy_utils",
654654
"itertools",
@@ -671,7 +671,7 @@ dependencies = [
671671

672672
[[package]]
673673
name = "clippy_lints"
674-
version = "0.1.93"
674+
version = "0.1.94"
675675
dependencies = [
676676
"arrayvec",
677677
"cargo_metadata 0.18.1",
@@ -703,7 +703,7 @@ dependencies = [
703703

704704
[[package]]
705705
name = "clippy_utils"
706-
version = "0.1.93"
706+
version = "0.1.94"
707707
dependencies = [
708708
"arrayvec",
709709
"itertools",
@@ -1107,7 +1107,7 @@ dependencies = [
11071107

11081108
[[package]]
11091109
name = "declare_clippy_lint"
1110-
version = "0.1.93"
1110+
version = "0.1.94"
11111111

11121112
[[package]]
11131113
name = "derive-where"
@@ -3945,6 +3945,7 @@ dependencies = [
39453945
"rustc_hashes",
39463946
"rustc_hir_id",
39473947
"rustc_index",
3948+
"rustc_lint_defs",
39483949
"rustc_macros",
39493950
"rustc_serialize",
39503951
"rustc_span",
@@ -3962,14 +3963,14 @@ dependencies = [
39623963
"rustc_abi",
39633964
"rustc_arena",
39643965
"rustc_ast",
3965-
"rustc_attr_parsing",
39663966
"rustc_data_structures",
39673967
"rustc_errors",
39683968
"rustc_feature",
39693969
"rustc_fluent_macro",
39703970
"rustc_hir",
39713971
"rustc_index",
39723972
"rustc_infer",
3973+
"rustc_lint",
39733974
"rustc_lint_defs",
39743975
"rustc_macros",
39753976
"rustc_middle",
@@ -5615,6 +5616,7 @@ dependencies = [
56155616
"semver",
56165617
"serde",
56175618
"similar",
5619+
"tempfile",
56185620
"termcolor",
56195621
"toml 0.7.8",
56205622
"walkdir",

RELEASES.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,88 @@
1+
Version 1.92.0 (2025-12-11)
2+
==========================
3+
4+
<a id="1.92.0-Language"></a>
5+
6+
Language
7+
--------
8+
- [Document `MaybeUninit` representation and validity](https://github.com/rust-lang/rust/pull/140463)
9+
- [Allow `&raw [mut | const]` for union field in safe code](https://github.com/rust-lang/rust/pull/141469)
10+
- [Prefer item bounds of associated types over where-bounds for auto-traits and `Sized`](https://github.com/rust-lang/rust/pull/144064)
11+
- [Do not materialize `X` in `[X; 0]` when `X` is unsizing a const](https://github.com/rust-lang/rust/pull/145277)
12+
- [Support combining `#[track_caller]` and `#[no_mangle]` (requires every declaration specifying `#[track_caller]` as well)](https://github.com/rust-lang/rust/pull/145724)
13+
- [Make never type lints `never_type_fallback_flowing_into_unsafe` and `dependency_on_unit_never_type_fallback` deny-by-default](https://github.com/rust-lang/rust/pull/146167)
14+
- [Allow specifying multiple bounds for same associated item, except in trait objects](https://github.com/rust-lang/rust/pull/146593)
15+
- [Slightly strengthen higher-ranked region handling in coherence](https://github.com/rust-lang/rust/pull/146725)
16+
- [The `unused_must_use` lint no longer warns on `Result<(), Uninhabited>` (for instance, `Result<(), !>`), or `ControlFlow<Uninhabited, ()>`](https://github.com/rust-lang/rust/pull/147382). This avoids having to check for an error that can never happen.
17+
18+
<a id="1.92.0-Compiler"></a>
19+
20+
Compiler
21+
--------
22+
- [Make `mips64el-unknown-linux-muslabi64` link dynamically](https://github.com/rust-lang/rust/pull/146858)
23+
- [Remove current code for embedding command-line args in PDB](https://github.com/rust-lang/rust/pull/147022)
24+
Command-line information is typically not needed by debugging tools, and the removed code
25+
was causing problems for incremental builds even on targets that don't use PDB debuginfo.
26+
27+
<a id="1.92.0-Libraries"></a>
28+
29+
Libraries
30+
---------
31+
- [Specialize `Iterator::eq{_by}` for `TrustedLen` iterators](https://github.com/rust-lang/rust/pull/137122)
32+
- [Simplify `Extend` for tuples](https://github.com/rust-lang/rust/pull/138799)
33+
- [Added details to `Debug` for `EncodeWide`](https://github.com/rust-lang/rust/pull/140153).
34+
- [`iter::Repeat::last`](https://github.com/rust-lang/rust/pull/147258) and [`count`](https://github.com/rust-lang/rust/pull/146410) will now panic, rather than looping infinitely.
35+
36+
<a id="1.92.0-Stabilized-APIs"></a>
37+
38+
Stabilized APIs
39+
---------------
40+
41+
- [`NonZero<u{N}>::div_ceil`](https://doc.rust-lang.org/stable/std/num/struct.NonZero.html#method.div_ceil)
42+
- [`Location::file_as_c_str`](https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.file_as_c_str)
43+
- [`RwLockWriteGuard::downgrade`](https://doc.rust-lang.org/stable/std/sync/struct.RwLockWriteGuard.html#method.downgrade)
44+
- [`Box::new_zeroed`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.new_zeroed)
45+
- [`Box::new_zeroed_slice`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.new_zeroed_slice)
46+
- [`Rc::new_zeroed`](https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.new_zeroed)
47+
- [`Rc::new_zeroed_slice`](https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.new_zeroed_slice)
48+
- [`Arc::new_zeroed`](https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#method.new_zeroed)
49+
- [`Arc::new_zeroed_slice`](https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#method.new_zeroed_slice)
50+
- [`btree_map::Entry::insert_entry`](https://doc.rust-lang.org/stable/std/collections/btree_map/enum.Entry.html#method.insert_entry)
51+
- [`btree_map::VacantEntry::insert_entry`](https://doc.rust-lang.org/stable/std/collections/btree_map/struct.VacantEntry.html#method.insert_entry)
52+
- [`impl Extend<proc_macro::Group> for proc_macro::TokenStream`](https://doc.rust-lang.org/stable/proc_macro/struct.TokenStream.html#impl-Extend%3CGroup%3E-for-TokenStream)
53+
- [`impl Extend<proc_macro::Literal> for proc_macro::TokenStream`](https://doc.rust-lang.org/stable/proc_macro/struct.TokenStream.html#impl-Extend%3CLiteral%3E-for-TokenStream)
54+
- [`impl Extend<proc_macro::Punct> for proc_macro::TokenStream`](https://doc.rust-lang.org/stable/proc_macro/struct.TokenStream.html#impl-Extend%3CPunct%3E-for-TokenStream)
55+
- [`impl Extend<proc_macro::Ident> for proc_macro::TokenStream`](https://doc.rust-lang.org/stable/proc_macro/struct.TokenStream.html#impl-Extend%3CIdent%3E-for-TokenStream)
56+
57+
These previously stable APIs are now stable in const contexts:
58+
59+
- [`<[_]>::rotate_left`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.rotate_left)
60+
- [`<[_]>::rotate_right`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.rotate_right)
61+
62+
<a id="1.92.0-Cargo"></a>
63+
64+
Cargo
65+
-----
66+
- [Added a new chapter](https://github.com/rust-lang/cargo/issues/16119) to the Cargo book, ["Optimizing Build Performance"](https://doc.rust-lang.org/stable/cargo/guide/build-performance.html).
67+
68+
<a id="1.92.0-Rustdoc"></a>
69+
70+
Rustdoc
71+
-----
72+
- [If a trait item appears in rustdoc search, hide the corresponding impl items](https://github.com/rust-lang/rust/pull/145898). Previously a search for "last" would show both `Iterator::last` as well as impl methods like `std::vec::IntoIter::last`. Now these impl methods will be hidden, freeing up space for inherent methods like `BTreeSet::last`.
73+
- [Relax rules for identifiers in search](https://github.com/rust-lang/rust/pull/147860). Previously you could only search for identifiers that were valid in rust code, now searches only need to be valid as part of an identifier. For example, you can now perform a search that starts with a digit.
74+
75+
<a id="1.92.0-Compatibility-Notes"></a>
76+
77+
Compatibility Notes
78+
-------------------
79+
* [Fix backtraces with `-C panic=abort` on Linux by generating unwind tables by default](https://github.com/rust-lang/rust/pull/143613). Build with `-C force-unwind-tables=no` to keep omitting unwind tables.
80+
- As part of the larger effort refactoring compiler built-in attributes and their diagnostics, [the future-compatibility lint `invalid_macro_export_arguments` is upgraded to deny-by-default and will be reported in dependencies too.](https://github.com/rust-lang/rust/pull/143857)
81+
- [Update the minimum external LLVM to 20](https://github.com/rust-lang/rust/pull/145071)
82+
- [Prevent downstream `impl DerefMut for Pin<LocalType>`](https://github.com/rust-lang/rust/pull/145608)
83+
- [Don't apply temporary lifetime extension rules to the arguments of non-extended `pin!` and formatting macros](https://github.com/rust-lang/rust/pull/145838)
84+
85+
186
Version 1.91.1 (2025-11-10)
287
===========================
388

compiler/rustc_ast/src/ast.rs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,19 @@ pub enum StmtKind {
12591259
MacCall(Box<MacCallStmt>),
12601260
}
12611261

1262+
impl StmtKind {
1263+
pub fn descr(&self) -> &'static str {
1264+
match self {
1265+
StmtKind::Let(_) => "local",
1266+
StmtKind::Item(_) => "item",
1267+
StmtKind::Expr(_) => "expression",
1268+
StmtKind::Semi(_) => "statement",
1269+
StmtKind::Empty => "semicolon",
1270+
StmtKind::MacCall(_) => "macro call",
1271+
}
1272+
}
1273+
}
1274+
12621275
#[derive(Clone, Encodable, Decodable, Debug, Walkable)]
12631276
pub struct MacCallStmt {
12641277
pub mac: Box<MacCall>,
@@ -1806,8 +1819,14 @@ pub enum ExprKind {
18061819
/// A use expression (`x.use`). Span is of use keyword.
18071820
Use(Box<Expr>, Span),
18081821

1809-
/// A try block (`try { ... }`).
1810-
TryBlock(Box<Block>),
1822+
/// A try block (`try { ... }`), if the type is `None`, or
1823+
/// A try block (`try bikeshed Ty { ... }`) if the type is `Some`.
1824+
///
1825+
/// Note that `try bikeshed` is a *deliberately ridiculous* placeholder
1826+
/// syntax to avoid deciding what keyword or symbol should go there.
1827+
/// It's that way for experimentation only; an RFC to decide the final
1828+
/// semantics and syntax would be needed to put it on stabilization-track.
1829+
TryBlock(Box<Block>, Option<Box<Ty>>),
18111830

18121831
/// An assignment (`a = foo()`).
18131832
/// The `Span` argument is the span of the `=` token.

compiler/rustc_ast/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
//! This API is completely unstable and subject to change.
66
77
// tidy-alphabetical-start
8+
#![cfg_attr(bootstrap, feature(array_windows))]
89
#![doc(test(attr(deny(warnings), allow(internal_features))))]
9-
#![feature(array_windows)]
1010
#![feature(associated_type_defaults)]
1111
#![feature(box_patterns)]
1212
#![feature(if_let_guard)]

compiler/rustc_ast/src/visit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,8 @@ macro_rules! common_visitor_and_walkers {
10481048
visit_visitable!($($mut)? vis, kind),
10491049
ExprKind::Try(subexpression) =>
10501050
visit_visitable!($($mut)? vis, subexpression),
1051-
ExprKind::TryBlock(body) =>
1052-
visit_visitable!($($mut)? vis, body),
1051+
ExprKind::TryBlock(body, optional_type) =>
1052+
visit_visitable!($($mut)? vis, body, optional_type),
10531053
ExprKind::Lit(token) =>
10541054
visit_visitable!($($mut)? vis, token),
10551055
ExprKind::IncludedBytes(bytes) =>

compiler/rustc_ast_lowering/src/contract.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
2323
// The order in which things are lowered is important! I.e to
2424
// refer to variables in contract_decls from postcond/precond,
2525
// we must lower it first!
26-
let contract_decls = self.lower_stmts(&contract.declarations).0;
26+
let contract_decls = self.lower_decls(contract);
2727

2828
match (&contract.requires, &contract.ensures) {
2929
(Some(req), Some(ens)) => {
@@ -124,6 +124,18 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
124124
}
125125
}
126126

127+
fn lower_decls(&mut self, contract: &rustc_ast::FnContract) -> &'hir [rustc_hir::Stmt<'hir>] {
128+
let (decls, decls_tail) = self.lower_stmts(&contract.declarations);
129+
130+
if let Some(e) = decls_tail {
131+
// include the tail expression in the declaration statements
132+
let tail = self.stmt_expr(e.span, *e);
133+
self.arena.alloc_from_iter(decls.into_iter().map(|d| *d).chain([tail].into_iter()))
134+
} else {
135+
decls
136+
}
137+
}
138+
127139
/// Lower the precondition check intrinsic.
128140
fn lower_precond(&mut self, req: &Box<rustc_ast::Expr>) -> rustc_hir::Stmt<'hir> {
129141
let lowered_req = self.lower_expr_mut(&req);

compiler/rustc_ast_lowering/src/delegation.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ use hir::{BodyId, HirId};
4444
use rustc_abi::ExternAbi;
4545
use rustc_ast::*;
4646
use rustc_errors::ErrorGuaranteed;
47+
use rustc_hir::attrs::{AttributeKind, InlineAttr};
4748
use rustc_hir::def_id::DefId;
4849
use rustc_middle::span_bug;
4950
use rustc_middle::ty::{Asyncness, ResolverAstLowering};
@@ -87,6 +88,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
8788
let sig_id = self.get_delegation_sig_id(item_id, delegation.id, span, is_in_trait_impl);
8889
match sig_id {
8990
Ok(sig_id) => {
91+
self.add_inline_attribute_if_needed(span);
92+
9093
let is_method = self.is_method(sig_id, span);
9194
let (param_count, c_variadic) = self.param_count(sig_id);
9295
let decl = self.lower_delegation_decl(sig_id, param_count, c_variadic, span);
@@ -100,6 +103,31 @@ impl<'hir> LoweringContext<'_, 'hir> {
100103
}
101104
}
102105

106+
fn add_inline_attribute_if_needed(&mut self, span: Span) {
107+
const PARENT_ID: hir::ItemLocalId = hir::ItemLocalId::ZERO;
108+
let create_inline_attr_slice =
109+
|| [hir::Attribute::Parsed(AttributeKind::Inline(InlineAttr::Hint, span))];
110+
111+
let new_attributes = match self.attrs.get(&PARENT_ID) {
112+
Some(attrs) => {
113+
// Check if reuse already specifies any inline attribute, if so, do nothing
114+
if attrs
115+
.iter()
116+
.any(|a| matches!(a, hir::Attribute::Parsed(AttributeKind::Inline(..))))
117+
{
118+
return;
119+
}
120+
121+
self.arena.alloc_from_iter(
122+
attrs.into_iter().map(|a| a.clone()).chain(create_inline_attr_slice()),
123+
)
124+
}
125+
None => self.arena.alloc_from_iter(create_inline_attr_slice()),
126+
};
127+
128+
self.attrs.insert(PARENT_ID, new_attributes);
129+
}
130+
103131
fn get_delegation_sig_id(
104132
&self,
105133
item_id: NodeId,

0 commit comments

Comments
 (0)