Skip to content

Commit cec4a23

Browse files
authored
Merge pull request #2635 from rust-lang/rustc-pull
Rustc pull update
2 parents bc59f94 + 68710f6 commit cec4a23

File tree

1,642 files changed

+38344
-16290
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,642 files changed

+38344
-16290
lines changed

.mailmap

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Aaron Todd <[email protected]>
99
Abhishek Chanda <[email protected]> Abhishek Chanda <[email protected]>
1010
Abhijeet Bhagat <[email protected]>
1111
Abroskin Alexander <[email protected]>
12-
Adolfo Ochagavía <[email protected]>
12+
1313
Adrian Heine né Lang <[email protected]>
1414
Adrien Tétar <[email protected]>
1515
@@ -36,6 +36,7 @@ Amanda Stjerna <[email protected]> <[email protected]>
3636
3737
3838
39+
3940
Ana-Maria Mihalache <[email protected]>
4041
Anatoly Ikorsky <[email protected]>
4142
Andre Bogus <[email protected]>
@@ -138,7 +139,6 @@ Christian Poveda <[email protected]> <[email protected].
138139
139140
Christian Vallentin <[email protected]>
140141
Christoffer Buchholz <[email protected]>
141-
Christopher Durham <[email protected]>
142142
143143
Clement Miao <[email protected]>
144144
Clément Renault <[email protected]>
@@ -147,6 +147,7 @@ Clinton Ryan <[email protected]>
147147
148148
149149
Crazycolorz5 <[email protected]>
150+
Crystal Durham <[email protected]>
150151
151152
Cyryl Płotnicki <[email protected]>
152153
Damien Schoof <[email protected]>
@@ -276,7 +277,8 @@ Irina Popa <[email protected]>
276277
Ivan Ivaschenko <[email protected]>
277278
ivan tkachenko <[email protected]>
278279
J. J. Weber <[email protected]>
279-
280+
281+
280282
281283
Jacob Hoffman-Andrews <[email protected]> <[email protected]>
282284
Jacob Greenfield <[email protected]>
@@ -292,6 +294,8 @@ Jakub Adam Wieczorek <[email protected]>
292294
Jakub Adam Wieczorek <[email protected]> <[email protected]>
293295
Jakub Adam Wieczorek <[email protected]> <[email protected]>
294296
Jakub Adam Wieczorek <[email protected]> <[email protected]>
297+
Jakub Adam Wieczorek <[email protected]> <[email protected]>
298+
Jakub Adam Wieczorek <[email protected]> <[email protected]>
295299
296300
James [Undefined] <[email protected]>
297301
@@ -303,6 +307,7 @@ Jamie Hill-Daniel <[email protected]> <[email protected]>
303307
Jana Dönszelmann <[email protected]>
304308
305309
310+
306311
307312
Jaro Fietz <[email protected]>
308313
Jason Fager <[email protected]>
@@ -313,6 +318,7 @@ Jason Toffaletti <[email protected]> Jason Toffaletti <[email protected]>
313318
Jauhien Piatlicki <[email protected]> Jauhien Piatlicki <[email protected]>
314319
315320
Jeremy Letang <[email protected]>
321+
316322
Jeremy Sorensen <[email protected]>
317323
318324
@@ -336,6 +342,7 @@ John Kåre Alsaker <[email protected]>
336342
John Kåre Alsaker <[email protected]> <[email protected]>
337343
John Talling <[email protected]>
338344
John Van Enk <[email protected]>
345+
339346
Jonas Tepe <[email protected]>
340347
341348
Jonathan Chan Kwan Yin <[email protected]>
@@ -424,7 +431,7 @@ Malo Jaffré <[email protected]>
424431
Manish Goregaokar <[email protected]>
425432
426433
Marcell Pardavi <[email protected]>
427-
Marco Ieni <[email protected]>
434+
428435
Marcus Klaas de Vries <[email protected]>
429436
Margaret Meyerhofer <[email protected]> <mmeyerho@andrew>
430437
@@ -531,6 +538,7 @@ Oliver Scherer <[email protected]> <[email protected]>
531538
532539
533540
Oliver Scherer <[email protected]>
541+
534542
535543
Onur Özkan <[email protected]>
536544
Ömer Sinan Ağacan <[email protected]>
@@ -591,6 +599,7 @@ Rusty Blitzerr <[email protected]>
591599
RustyYato <[email protected]>
592600
Ruud van Asseldonk <[email protected]> Ruud van Asseldonk <[email protected]>
593601
Ryan Leung <[email protected]>
602+
594603
Ryan Scheel <[email protected]>
595604
Ryan Sullivant <[email protected]>
596605
Ryan Wiedemann <[email protected]>
@@ -686,6 +695,8 @@ Weihang Lo <[email protected]>
686695
687696
688697
whitequark <[email protected]>
698+
699+
689700
690701
691702
@@ -695,6 +706,8 @@ Xinye Tao <[email protected]>
695706
Xuefeng Wu <[email protected]> Xuefeng Wu <[email protected]>
696707
Xuefeng Wu <[email protected]> XuefengWu <[email protected]>
697708
York Xiang <[email protected]>
709+
710+
698711
699712
700713
Youngsuk Kim <[email protected]>

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)