Skip to content

Commit 68710f6

Browse files
author
The rustc-josh-sync Cronjob Bot
committed
Merge ref '8401398e1f14' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 8401398 Filtered ref: 52a911b7100ca6a6ed84159c51ce514a98ae9cf5 Upstream diff: c5dabe8...8401398 This merge was created using https://github.com/rust-lang/josh-sync.
2 parents ed09431 + 8401398 commit 68710f6

File tree

1,641 files changed

+38343
-16289
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,641 files changed

+38343
-16289
lines changed

.mailmap

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Aaron Todd <github@opprobrio.us>
99
Abhishek Chanda <abhishek.becs@gmail.com> Abhishek Chanda <abhishek@cloudscaling.com>
1010
Abhijeet Bhagat <abhijeet.bhagat@gmx.com>
1111
Abroskin Alexander <arkweid@evilmartians.com>
12-
Adolfo Ochagavía <aochagavia92@gmail.com>
12+
Adolfo Ochagavía <aochagavia92@gmail.com> <github@adolfo.ochagavia.xyz>
1313
Adrian Heine né Lang <mail@adrianheine.de>
1414
Adrien Tétar <adri-from-59@hotmail.fr>
1515
Ahmed Charles <ahmedcharles@gmail.com> <acharles@outlook.com>
@@ -36,6 +36,7 @@ Amanda Stjerna <mail@amandastjerna.se> <albin.stjerna@gmail.com>
3636
Amanda Stjerna <mail@amandastjerna.se> <amanda.stjerna@it.uu.se>
3737
Amanieu d'Antras <amanieu@gmail.com> <amanieu.dantras@huawei.com>
3838
Amos Onn <amosonn@gmail.com>
39+
Amos Wenger <amoswenger@gmail.com> <fasterthanlime@users.noreply.github.com>
3940
Ana-Maria Mihalache <mihalacheana.maria@yahoo.com>
4041
Anatoly Ikorsky <aikorsky@gmail.com>
4142
Andre Bogus <bogusandre@gmail.com>
@@ -138,7 +139,6 @@ Christian Poveda <git@pvdrz.com> <31802960+christianpoveda@users.noreply.github.
138139
Christian Poveda <git@pvdrz.com> <christianpoveda@uhura.edef.eu>
139140
Christian Vallentin <vallentinsource@gmail.com>
140141
Christoffer Buchholz <chris@chrisbuchholz.me>
141-
Christopher Durham <cad97@cad97.com>
142142
Clark Gaebel <cg.wowus.cg@gmail.com> <cgaebel@mozilla.com>
143143
Clement Miao <clementmiao@gmail.com>
144144
Clément Renault <renault.cle@gmail.com>
@@ -147,6 +147,7 @@ Clinton Ryan <clint.ryan3@gmail.com>
147147
Taylor Cramer <cramertaylorj@gmail.com> <cramertj@google.com>
148148
ember arlynx <ember@lunar.town> <corey@octayn.net>
149149
Crazycolorz5 <Crazycolorz5@gmail.com>
150+
Crystal Durham <cad97@cad97.com>
150151
csmoe <35686186+csmoe@users.noreply.github.com>
151152
Cyryl Płotnicki <cyplo@cyplo.net>
152153
Damien Schoof <damien.schoof@gmail.com>
@@ -276,7 +277,8 @@ Irina Popa <irinagpopa@gmail.com>
276277
Ivan Ivaschenko <defuz.net@gmail.com>
277278
ivan tkachenko <me@ratijas.tk>
278279
J. J. Weber <jjweber@gmail.com>
279-
Jack Huey <jack.huey@umassmed.edu> <jackh726@gmail.com>
280+
Jack Huey <jackh726@gmail.com> <jack.huey@umassmed.edu>
281+
Jack Huey <jackh726@gmail.com> <31162821+jackh726@users.noreply.github.com>
280282
Jacob <jacob.macritchie@gmail.com>
281283
Jacob Hoffman-Andrews <rust@hoffman-andrews.com> <github@hoffman-andrews.com>
282284
Jacob Greenfield <xales@naveria.com>
@@ -292,6 +294,8 @@ Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com>
292294
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakub.bukaj@yahoo.com>
293295
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakub@jakub.cc>
294296
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakubw@jakubw.net>
297+
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <ja.wieczorek@student.uw.edu.pl>
298+
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <software@jacobadam.net>
295299
Jakub Beránek <berykubik@gmail.com> <jakub.beranek@vsb.cz>
296300
James [Undefined] <tpzker@thepuzzlemaker.info>
297301
James Deng <cnjamesdeng@gmail.com> <cnJamesDeng@gmail.com>
@@ -303,6 +307,7 @@ Jamie Hill-Daniel <jamie@hill-daniel.co.uk> <clubby789@gmail.com>
303307
Jana Dönszelmann <jana@donsz.nl>
304308
Jana Dönszelmann <jana@donsz.nl> <jonathan@donsz.nl>
305309
Jana Dönszelmann <jana@donsz.nl> <jonabent@gmail.com>
310+
Jane Lusby <jlusby42@gmail.com> <jlusby@yaah.dev>
306311
Jan-Erik Rediger <janerik@fnordig.de> <badboy@archlinux.us>
307312
Jaro Fietz <jaro.fietz@gmx.de>
308313
Jason Fager <jfager@gmail.com>
@@ -313,6 +318,7 @@ Jason Toffaletti <toffaletti@gmail.com> Jason Toffaletti <jason@topsy.com>
313318
Jauhien Piatlicki <jauhien@gentoo.org> Jauhien Piatlicki <jpiatlicki@zertisa.com>
314319
Jay True <glacjay@gmail.com>
315320
Jeremy Letang <letang.jeremy@gmail.com>
321+
Jeremy Soller <jackpot51@gmail.com> <jeremy@system76.com>
316322
Jeremy Sorensen <jeremy.a.sorensen@gmail.com>
317323
Jeremy Stucki <dev@jeremystucki.ch> <stucki.jeremy@gmail.com>
318324
Jeremy Stucki <dev@jeremystucki.ch> <jeremy@myelin.ch>
@@ -336,6 +342,7 @@ John Kåre Alsaker <john.kare.alsaker@gmail.com>
336342
John Kåre Alsaker <john.kare.alsaker@gmail.com> <zoxc32@gmail.com>
337343
John Talling <inrustwetrust@users.noreply.github.com>
338344
John Van Enk <vanenkj@gmail.com>
345+
Jon Gjengset <jon@thesquareplanet.com> <jongje@amazon.com>
339346
Jonas Tepe <jonasprogrammer@gmail.com>
340347
Jonathan Bailey <jbailey@mozilla.com> <jbailey@jbailey-20809.local>
341348
Jonathan Chan Kwan Yin <sofe2038@gmail.com>
@@ -424,7 +431,7 @@ Malo Jaffré <jaffre.malo@gmail.com>
424431
Manish Goregaokar <manishsmail@gmail.com>
425432
Mara Bos <m-ou.se@m-ou.se>
426433
Marcell Pardavi <marcell.pardavi@gmail.com>
427-
Marco Ieni <11428655+MarcoIeni@users.noreply.github.com>
434+
Marco Ieni <marcoieni@rustfoundation.org> <11428655+MarcoIeni@users.noreply.github.com>
428435
Marcus Klaas de Vries <mail@marcusklaas.nl>
429436
Margaret Meyerhofer <mmeyerho@andrew.cmu.edu> <mmeyerho@andrew>
430437
Marijn Schouten <mhkbst@gmail.com> <hkBst@users.noreply.github.com>
@@ -531,6 +538,7 @@ Oliver Scherer <oli-obk@users.noreply.github.com> <oliver.schneider@kit.edu>
531538
Oliver Scherer <oli-obk@users.noreply.github.com> <obk8176014uqher834@olio-obk.de>
532539
Oliver Scherer <oli-obk@users.noreply.github.com> <rustc-contact@oli-obk.de>
533540
Oliver Scherer <oli-obk@users.noreply.github.com>
541+
Onur Özkan <onurozkan.dev@outlook.com> <contact@onurozkan.dev>
534542
Onur Özkan <onurozkan.dev@outlook.com> <work@onurozkan.dev>
535543
Onur Özkan <onurozkan.dev@outlook.com>
536544
Ömer Sinan Ağacan <omeragacan@gmail.com>
@@ -591,6 +599,7 @@ Rusty Blitzerr <rusty.blitzerr@gmail.com>
591599
RustyYato <krishna.sd.2012@gmail.com>
592600
Ruud van Asseldonk <dev@veniogames.com> Ruud van Asseldonk <ruuda@google.com>
593601
Ryan Leung <rleungx@gmail.com>
602+
Ryan Levick <me@ryanlevick.com> <rylev@users.noreply.github.com>
594603
Ryan Scheel <ryan.havvy@gmail.com>
595604
Ryan Sullivant <rsulli55@gmail.com>
596605
Ryan Wiedemann <Ryan1729@gmail.com>
@@ -686,6 +695,8 @@ Weihang Lo <me@weihanglo.tw>
686695
Weihang Lo <me@weihanglo.tw> <weihanglo@users.noreply.github.com>
687696
Wesley Wiser <wwiser@gmail.com> <wesleywiser@microsoft.com>
688697
whitequark <whitequark@whitequark.org>
698+
Will Crichton <crichton.will@gmail.com> <wcrichto@stanford.edu>
699+
Will Crichton <crichton.will@gmail.com> <wcrichto@cs.stanford.edu>
689700
William Ting <io@williamting.com> <william.h.ting@gmail.com>
690701
Wim Looman <wim@nemo157.com> <rust-lang@nemo157.com>
691702
Wim Looman <wim@nemo157.com> <git@nemo157.com>
@@ -695,6 +706,8 @@ Xinye Tao <xy.tao@outlook.com>
695706
Xuefeng Wu <benewu@gmail.com> Xuefeng Wu <xfwu@thoughtworks.com>
696707
Xuefeng Wu <benewu@gmail.com> XuefengWu <benewu@gmail.com>
697708
York Xiang <bombless@126.com>
709+
Yoshua Wuyts <yoshuawuyts@gmail.com> <yoshuawuyts+github@gmail.com>
710+
Yoshua Wuyts <yoshuawuyts@gmail.com> <2467194+yoshuawuyts@users.noreply.github.com>
698711
Yotam Ofek <yotam.ofek@gmail.com> <yotamofek@microsoft.com>
699712
Youngsoo Son <ysson83@gmail.com> <ysoo.son@samsung.com>
700713
Youngsuk Kim <joseph942010@gmail.com>

Cargo.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ dependencies = [
8080

8181
[[package]]
8282
name = "annotate-snippets"
83-
version = "0.12.7"
83+
version = "0.12.8"
8484
source = "registry+https://github.com/rust-lang/crates.io-index"
85-
checksum = "47224528f74de27d1d06aad6a5dda4f865b6ebe2e56c538943d746a7270cb67e"
85+
checksum = "025c7edcdffa4ccc5c0905f472a0ae3759378cfbef88ef518a3575e19ae3aebd"
8686
dependencies = [
8787
"anstyle",
8888
"unicode-width 0.2.2",
@@ -2334,9 +2334,9 @@ dependencies = [
23342334

23352335
[[package]]
23362336
name = "memchr"
2337-
version = "2.7.5"
2337+
version = "2.7.6"
23382338
source = "registry+https://github.com/rust-lang/crates.io-index"
2339-
checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
2339+
checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
23402340

23412341
[[package]]
23422342
name = "memmap2"
@@ -3766,7 +3766,7 @@ dependencies = [
37663766
name = "rustc_errors"
37673767
version = "0.0.0"
37683768
dependencies = [
3769-
"annotate-snippets 0.12.7",
3769+
"annotate-snippets 0.12.8",
37703770
"anstream",
37713771
"anstyle",
37723772
"derive_setters",

RELEASES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Version 1.91.1 (2025-11-10)
2+
===========================
3+
4+
<a id="1.91.1"></a>
5+
6+
- [Enable file locking support in illumos](https://github.com/rust-lang/rust/pull/148322). This fixes Cargo not locking the build directory on illumos.
7+
- [Fix `wasm_import_module` attribute cross-crate](https://github.com/rust-lang/rust/pull/148363). This fixes linker errors on WASM targets.
8+
19
Version 1.91.0 (2025-10-30)
210
==========================
311

compiler/rustc_abi/src/canon_abi.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ pub enum CanonAbi {
5151
X86(X86Call),
5252
}
5353

54+
impl CanonAbi {
55+
pub fn is_rustic_abi(self) -> bool {
56+
match self {
57+
CanonAbi::Rust | CanonAbi::RustCold => true,
58+
CanonAbi::C
59+
| CanonAbi::Custom
60+
| CanonAbi::Arm(_)
61+
| CanonAbi::GpuKernel
62+
| CanonAbi::Interrupt(_)
63+
| CanonAbi::X86(_) => false,
64+
}
65+
}
66+
}
67+
5468
impl fmt::Display for CanonAbi {
5569
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5670
// convert to the ExternAbi that *shares a string* with this CanonAbi.

compiler/rustc_abi/src/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
812812
let (max, min) = largest_niche
813813
// We might have no inhabited variants, so pretend there's at least one.
814814
.unwrap_or((0, 0));
815-
let (min_ity, signed) = discr_range_of_repr(min, max); //Integer::repr_discr(tcx, ty, &repr, min, max);
815+
let (min_ity, signed) = discr_range_of_repr(min, max); //Integer::discr_range_of_repr(tcx, ty, &repr, min, max);
816816

817817
let mut align = dl.aggregate_align;
818818
let mut max_repr_align = repr.align;

compiler/rustc_abi/src/layout/ty.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ pub trait TyAbiInterface<'a, C>: Sized + std::fmt::Debug {
172172
fn is_tuple(this: TyAndLayout<'a, Self>) -> bool;
173173
fn is_unit(this: TyAndLayout<'a, Self>) -> bool;
174174
fn is_transparent(this: TyAndLayout<'a, Self>) -> bool;
175+
/// See [`TyAndLayout::pass_indirectly_in_non_rustic_abis`] for details.
176+
fn is_pass_indirectly_in_non_rustic_abis_flag_set(this: TyAndLayout<'a, Self>) -> bool;
175177
}
176178

177179
impl<'a, Ty> TyAndLayout<'a, Ty> {
@@ -269,6 +271,30 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
269271
Ty::is_transparent(self)
270272
}
271273

274+
/// If this method returns `true`, then this type should always have a `PassMode` of
275+
/// `Indirect { on_stack: false, .. }` when being used as the argument type of a function with a
276+
/// non-Rustic ABI (this is true for structs annotated with the
277+
/// `#[rustc_pass_indirectly_in_non_rustic_abis]` attribute).
278+
///
279+
/// This is used to replicate some of the behaviour of C array-to-pointer decay; however unlike
280+
/// C any changes the caller makes to the passed value will not be reflected in the callee, so
281+
/// the attribute is only useful for types where observing the value in the caller after the
282+
/// function call isn't allowed (a.k.a. `va_list`).
283+
///
284+
/// This function handles transparent types automatically.
285+
pub fn pass_indirectly_in_non_rustic_abis<C>(mut self, cx: &C) -> bool
286+
where
287+
Ty: TyAbiInterface<'a, C> + Copy,
288+
{
289+
while self.is_transparent()
290+
&& let Some((_, field)) = self.non_1zst_field(cx)
291+
{
292+
self = field;
293+
}
294+
295+
Ty::is_pass_indirectly_in_non_rustic_abis_flag_set(self)
296+
}
297+
272298
/// Finds the one field that is not a 1-ZST.
273299
/// Returns `None` if there are multiple non-1-ZST fields or only 1-ZST-fields.
274300
pub fn non_1zst_field<C>(&self, cx: &C) -> Option<(FieldIdx, Self)>

compiler/rustc_abi/src/lib.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// tidy-alphabetical-start
22
#![cfg_attr(feature = "nightly", allow(internal_features))]
3-
#![cfg_attr(feature = "nightly", doc(rust_logo))]
43
#![cfg_attr(feature = "nightly", feature(assert_matches))]
54
#![cfg_attr(feature = "nightly", feature(rustc_attrs))]
6-
#![cfg_attr(feature = "nightly", feature(rustdoc_internals))]
75
#![cfg_attr(feature = "nightly", feature(step_trait))]
86
// tidy-alphabetical-end
97

@@ -88,14 +86,17 @@ bitflags! {
8886
const IS_C = 1 << 0;
8987
const IS_SIMD = 1 << 1;
9088
const IS_TRANSPARENT = 1 << 2;
91-
// Internal only for now. If true, don't reorder fields.
92-
// On its own it does not prevent ABI optimizations.
89+
/// Internal only for now. If true, don't reorder fields.
90+
/// On its own it does not prevent ABI optimizations.
9391
const IS_LINEAR = 1 << 3;
94-
// If true, the type's crate has opted into layout randomization.
95-
// Other flags can still inhibit reordering and thus randomization.
96-
// The seed stored in `ReprOptions.field_shuffle_seed`.
92+
/// If true, the type's crate has opted into layout randomization.
93+
/// Other flags can still inhibit reordering and thus randomization.
94+
/// The seed stored in `ReprOptions.field_shuffle_seed`.
9795
const RANDOMIZE_LAYOUT = 1 << 4;
98-
// Any of these flags being set prevent field reordering optimisation.
96+
/// If true, the type is always passed indirectly by non-Rustic ABIs.
97+
/// See [`TyAndLayout::pass_indirectly_in_non_rustic_abis`] for details.
98+
const PASS_INDIRECTLY_IN_NON_RUSTIC_ABIS = 1 << 5;
99+
/// Any of these flags being set prevent field reordering optimisation.
99100
const FIELD_ORDER_UNOPTIMIZABLE = ReprFlags::IS_C.bits()
100101
| ReprFlags::IS_SIMD.bits()
101102
| ReprFlags::IS_LINEAR.bits();
@@ -183,6 +184,11 @@ impl ReprOptions {
183184

184185
/// Returns the discriminant type, given these `repr` options.
185186
/// This must only be called on enums!
187+
///
188+
/// This is the "typeck type" of the discriminant, which is effectively the maximum size:
189+
/// discriminant values will be wrapped to fit (with a lint). Layout can later decide to use a
190+
/// smaller type for the tag that stores the discriminant at runtime and that will work just
191+
/// fine, it just induces casts when getting/setting the discriminant.
186192
pub fn discr_type(&self) -> IntegerType {
187193
self.int.unwrap_or(IntegerType::Pointer(true))
188194
}

compiler/rustc_arena/src/lib.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,13 @@
1212
#![allow(internal_features)]
1313
#![cfg_attr(test, feature(test))]
1414
#![deny(unsafe_op_in_unsafe_fn)]
15-
#![doc(
16-
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
17-
test(no_crate_inject, attr(deny(warnings)))
18-
)]
19-
#![doc(rust_logo)]
15+
#![doc(test(no_crate_inject, attr(deny(warnings), allow(internal_features))))]
2016
#![feature(core_intrinsics)]
2117
#![feature(decl_macro)]
2218
#![feature(dropck_eyepatch)]
2319
#![feature(maybe_uninit_slice)]
2420
#![feature(never_type)]
2521
#![feature(rustc_attrs)]
26-
#![feature(rustdoc_internals)]
2722
#![feature(unwrap_infallible)]
2823
// tidy-alphabetical-end
2924

compiler/rustc_ast/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2024"
66
[dependencies]
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
9-
memchr = "2.7.4"
9+
memchr = "2.7.6"
1010
rustc-literal-escaper = "0.0.5"
1111
rustc_ast_ir = { path = "../rustc_ast_ir" }
1212
rustc_data_structures = { path = "../rustc_data_structures" }

compiler/rustc_ast/src/ast.rs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,15 @@ impl Pat {
714714
}
715715
}
716716

717+
/// Strip off all reference patterns (`&`, `&mut`) and return the inner pattern.
718+
pub fn peel_refs(&self) -> &Pat {
719+
let mut current = self;
720+
while let PatKind::Ref(inner, _) = &current.kind {
721+
current = inner;
722+
}
723+
current
724+
}
725+
717726
/// Is this a `..` pattern?
718727
pub fn is_rest(&self) -> bool {
719728
matches!(self.kind, PatKind::Rest)
@@ -3759,10 +3768,29 @@ pub struct ConstItem {
37593768
pub ident: Ident,
37603769
pub generics: Generics,
37613770
pub ty: Box<Ty>,
3762-
pub expr: Option<Box<Expr>>,
3771+
pub rhs: Option<ConstItemRhs>,
37633772
pub define_opaque: Option<ThinVec<(NodeId, Path)>>,
37643773
}
37653774

3775+
#[derive(Clone, Encodable, Decodable, Debug, Walkable)]
3776+
pub enum ConstItemRhs {
3777+
TypeConst(AnonConst),
3778+
Body(Box<Expr>),
3779+
}
3780+
3781+
impl ConstItemRhs {
3782+
pub fn span(&self) -> Span {
3783+
self.expr().span
3784+
}
3785+
3786+
pub fn expr(&self) -> &Expr {
3787+
match self {
3788+
ConstItemRhs::TypeConst(anon_const) => &anon_const.value,
3789+
ConstItemRhs::Body(expr) => expr,
3790+
}
3791+
}
3792+
}
3793+
37663794
// Adding a new variant? Please update `test_item` in `tests/ui/macros/stringify.rs`.
37673795
#[derive(Clone, Encodable, Decodable, Debug)]
37683796
pub enum ItemKind {

0 commit comments

Comments
 (0)