Skip to content

Commit 54dd6f3

Browse files
committed
Auto merge of #146589 - Zalathar:rollup-vdeixrl, r=Zalathar
Rollup of 12 pull requests Successful merges: - #146338 (Extends AArch64 branch protection support to include GCS) - #146344 (tests/codegen-llvm: Make rust-abi-arch-specific-adjustment portable) - #146402 (interpret: fix overlapping aggregate initialization) - #146405 (Add relnotes for 1.90.0) - #146530 (rustc_codegen_llvm: Adjust RISC-V inline assembly's clobber list) - #146533 (Note some previous attempts to change the Default impl for `[T; 0]`) - #146539 (fix 404 MCP link) - #146546 (Switch `std::vec::PeekMut::pop` from self to this parameter.) - #146549 (On FreeBSD, use readdir instead of readdir_r) - #146559 (Fix typo in error message) - #146563 (bootstrap.py: disable incremental build for bootstrap in CI) - #146576 (opt-dist: don't set `RUST_LOG=collector=debug`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents f3fd3ef + 6058efe commit 54dd6f3

File tree

46 files changed

+348
-105
lines changed

Some content is hidden

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

46 files changed

+348
-105
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ Shohei Wada <[email protected]>
609609
Shotaro Yamada <[email protected]>
610610
611611
Shyam Sundar B <[email protected]>
612+
612613
Simon Barber-Dueck <[email protected]> Simon BD <simon@server>
613614
614615
Simonas Kazlauskas <[email protected]> Simonas Kazlauskas <[email protected]>

RELEASES.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,129 @@
1+
Version 1.90 (2025-09-18)
2+
==========================
3+
4+
<a id="1.90-Language"></a>
5+
6+
Language
7+
--------
8+
- [Split up the `unknown_or_malformed_diagnostic_attributes` lint](https://github.com/rust-lang/rust/pull/140717). This lint has been split up into four finer-grained lints, with `unknown_or_malformed_diagnostic_attributes` now being the lint group that contains these lints:
9+
1. `unknown_diagnostic_attributes`: unknown to the current compiler
10+
2. `misplaced_diagnostic_attributes`: placed on the wrong item
11+
3. `malformed_diagnostic_attributes`: malformed attribute syntax or options
12+
4. `malformed_diagnostic_format_literals`: malformed format string literal
13+
- [Allow constants whose final value has references to mutable/external memory, but reject such constants as patterns](https://github.com/rust-lang/rust/pull/140942)
14+
- [Allow volatile access to non-Rust memory, including address 0](https://github.com/rust-lang/rust/pull/141260)
15+
16+
17+
<a id="1.90-Compiler"></a>
18+
19+
Compiler
20+
--------
21+
- [Use `lld` by default on `x86_64-unknown-linux-gnu`](https://github.com/rust-lang/rust/pull/140525).
22+
- [Tier 3 `musl` targets now link dynamically by default](https://github.com/rust-lang/rust/pull/144410). Affected targets:
23+
- `mips64-unknown-linux-muslabi64`
24+
- `powerpc64-unknown-linux-musl`
25+
- `powerpc-unknown-linux-musl`
26+
- `powerpc-unknown-linux-muslspe`
27+
- `riscv32gc-unknown-linux-musl`
28+
- `s390x-unknown-linux-musl`
29+
- `thumbv7neon-unknown-linux-musleabihf`
30+
31+
32+
<a id="1.90-Platform-Support"></a>
33+
34+
Platform Support
35+
----------------
36+
- [Demote `x86_64-apple-darwin` to Tier 2 with host tools](https://github.com/rust-lang/rust/pull/145252)
37+
38+
39+
Refer to Rust's [platform support page][platform-support-doc]
40+
for more information on Rust's tiered platform support.
41+
42+
[platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html
43+
44+
<a id="1.90-Libraries"></a>
45+
46+
Libraries
47+
---------
48+
- [Stabilize `u*::{checked,overflowing,saturating,wrapping}_sub_signed`](https://github.com/rust-lang/rust/issues/126043)
49+
- [Allow comparisons between `CStr`, `CString`, and `Cow<CStr>`](https://github.com/rust-lang/rust/pull/137268)
50+
- [Remove some unsized tuple impls since unsized tuples can't be constructed](https://github.com/rust-lang/rust/pull/138340)
51+
- [Set `MSG_NOSIGNAL` for `UnixStream`](https://github.com/rust-lang/rust/pull/140005)
52+
- [`proc_macro::Ident::new` now supports `$crate`.](https://github.com/rust-lang/rust/pull/141996)
53+
- [Guarantee the pointer returned from `Thread::into_raw` has at least 8 bytes of alignment](https://github.com/rust-lang/rust/pull/143859)
54+
55+
56+
<a id="1.90-Stabilized-APIs"></a>
57+
58+
Stabilized APIs
59+
---------------
60+
61+
- [`u{n}::checked_sub_signed`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.checked_sub_signed)
62+
- [`u{n}::overflowing_sub_signed`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.overflowing_sub_signed)
63+
- [`u{n}::saturating_sub_signed`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.saturating_sub_signed)
64+
- [`u{n}::wrapping_sub_signed`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.wrapping_sub_signed)
65+
- [`impl Copy for IntErrorKind`](https://doc.rust-lang.org/stable/std/num/enum.IntErrorKind.html#impl-Copy-for-IntErrorKind)
66+
- [`impl Hash for IntErrorKind`](https://doc.rust-lang.org/stable/std/num/enum.IntErrorKind.html#impl-Hash-for-IntErrorKind)
67+
- [`impl PartialEq<&CStr> for CStr`](https://doc.rust-lang.org/stable/std/ffi/struct.CStr.html#impl-PartialEq%3C%26CStr%3E-for-CStr)
68+
- [`impl PartialEq<CString> for CStr`](https://doc.rust-lang.org/stable/std/ffi/struct.CStr.html#impl-PartialEq%3CCString%3E-for-CStr)
69+
- [`impl PartialEq<Cow<CStr>> for CStr`](https://doc.rust-lang.org/stable/std/ffi/struct.CStr.html#impl-PartialEq%3CCow%3C'_,+CStr%3E%3E-for-CStr)
70+
- [`impl PartialEq<&CStr> for CString`](https://doc.rust-lang.org/stable/std/ffi/struct.CString.html#impl-PartialEq%3C%26CStr%3E-for-CString)
71+
- [`impl PartialEq<CStr> for CString`](https://doc.rust-lang.org/stable/std/ffi/struct.CString.html#impl-PartialEq%3CCStr%3E-for-CString)
72+
- [`impl PartialEq<Cow<CStr>> for CString`](https://doc.rust-lang.org/stable/std/ffi/struct.CString.html#impl-PartialEq%3CCow%3C'_,+CStr%3E%3E-for-CString)
73+
- [`impl PartialEq<&CStr> for Cow<CStr>`](https://doc.rust-lang.org/stable/std/borrow/enum.Cow.html#impl-PartialEq%3C%26CStr%3E-for-Cow%3C'_,+CStr%3E)
74+
- [`impl PartialEq<CStr> for Cow<CStr>`](https://doc.rust-lang.org/stable/std/borrow/enum.Cow.html#impl-PartialEq%3CCStr%3E-for-Cow%3C'_,+CStr%3E)
75+
- [`impl PartialEq<CString> for Cow<CStr>`](https://doc.rust-lang.org/stable/std/borrow/enum.Cow.html#impl-PartialEq%3CCString%3E-for-Cow%3C'_,+CStr%3E)
76+
77+
78+
These previously stable APIs are now stable in const contexts:
79+
80+
- [`<[T]>::reverse`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.reverse)
81+
- [`f32::floor`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.floor)
82+
- [`f32::ceil`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.ceil)
83+
- [`f32::trunc`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.trunc)
84+
- [`f32::fract`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.fract)
85+
- [`f32::round`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.round)
86+
- [`f32::round_ties_even`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.round_ties_even)
87+
- [`f64::floor`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.floor)
88+
- [`f64::ceil`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.ceil)
89+
- [`f64::trunc`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.trunc)
90+
- [`f64::fract`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.fract)
91+
- [`f64::round`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.round)
92+
- [`f64::round_ties_even`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.round_ties_even)
93+
94+
95+
<a id="1.90-Cargo"></a>
96+
97+
Cargo
98+
-----
99+
- [Add `http.proxy-cainfo` config for proxy certs](https://github.com/rust-lang/cargo/pull/15374/)
100+
- [Use `gix` for `cargo package`](https://github.com/rust-lang/cargo/pull/15534/)
101+
- [feat(publish): Stabilize multi-package publishing](https://github.com/rust-lang/cargo/pull/15636/)
102+
103+
<a id="1.90-Rustdoc"></a>
104+
105+
Rustdoc
106+
-----
107+
- [Add ways to collapse all impl blocks](https://github.com/rust-lang/rust/pull/141663). Previously the "Summary" button and "-" keyboard shortcut would never collapse `impl` blocks, now they do when shift is held
108+
- [Display unsafe attributes with `unsafe()` wrappers](https://github.com/rust-lang/rust/pull/143662)
109+
110+
111+
<a id="1.90-Compatibility-Notes"></a>
112+
113+
Compatibility Notes
114+
-------------------
115+
- [Use `lld` by default on `x86_64-unknown-linux-gnu`](https://github.com/rust-lang/rust/pull/140525).
116+
See also <https://blog.rust-lang.org/2025/09/01/rust-lld-on-1.90.0-stable/>.
117+
- [Make `core::iter::Fuse`'s `Default` impl construct `I::default()` internally as promised in the docs instead of always being empty](https://github.com/rust-lang/rust/pull/140985)
118+
- [Set `MSG_NOSIGNAL` for `UnixStream`](https://github.com/rust-lang/rust/pull/140005)
119+
This may change program behavior but results in the same behavior as other primitives (e.g., stdout, network sockets).
120+
Programs relying on signals to terminate them should update handling of sockets to handle errors on write by exiting.
121+
- [On Unix `std::env::home_dir` will use the fallback if the `HOME` environment variable is empty](https://github.com/rust-lang/rust/pull/141840)
122+
- We now [reject unsupported `extern "{abi}"`s consistently in all positions](https://github.com/rust-lang/rust/pull/142134). This primarily affects the use of implementing traits on an `extern "{abi}"` function pointer, like `extern "stdcall" fn()`, on a platform that doesn't support that, like aarch64-unknown-linux-gnu. Direct usage of these unsupported ABI strings by declaring or defining functions was already rejected, so this is only a change for consistency.
123+
- [const-eval: error when initializing a static writes to that static](https://github.com/rust-lang/rust/pull/143084)
124+
- [Check that the `proc_macro_derive` macro has correct arguments when applied to the crate root](https://github.com/rust-lang/rust/pull/143607)
125+
126+
1127
Version 1.89.0 (2025-08-07)
2128
==========================
3129

compiler/rustc_codegen_llvm/src/asm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
240240
}
241241
InlineAsmArch::RiscV32 | InlineAsmArch::RiscV64 => {
242242
constraints.extend_from_slice(&[
243+
"~{fflags}".to_string(),
243244
"~{vtype}".to_string(),
244245
"~{vl}".to_string(),
245246
"~{vxsat}".to_string(),

compiler/rustc_codegen_llvm/src/attributes.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,13 +407,16 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
407407
to_add.extend(sanitize_attrs(cx, codegen_fn_attrs.no_sanitize));
408408

409409
// For non-naked functions, set branch protection attributes on aarch64.
410-
if let Some(BranchProtection { bti, pac_ret }) =
410+
if let Some(BranchProtection { bti, pac_ret, gcs }) =
411411
cx.sess().opts.unstable_opts.branch_protection
412412
{
413413
assert!(cx.sess().target.arch == "aarch64");
414414
if bti {
415415
to_add.push(llvm::CreateAttrString(cx.llcx, "branch-target-enforcement"));
416416
}
417+
if gcs {
418+
to_add.push(llvm::CreateAttrString(cx.llcx, "guarded-control-stack"));
419+
}
417420
if let Some(PacRet { leaf, pc, key }) = pac_ret {
418421
if pc {
419422
to_add.push(llvm::CreateAttrString(cx.llcx, "branch-protection-pauth-lr"));

compiler/rustc_codegen_llvm/src/context.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,8 @@ pub(crate) unsafe fn create_module<'ll>(
390390
);
391391
}
392392

393-
if let Some(BranchProtection { bti, pac_ret }) = sess.opts.unstable_opts.branch_protection {
393+
if let Some(BranchProtection { bti, pac_ret, gcs }) = sess.opts.unstable_opts.branch_protection
394+
{
394395
if sess.target.arch == "aarch64" {
395396
llvm::add_module_flag_u32(
396397
llmod,
@@ -423,6 +424,12 @@ pub(crate) unsafe fn create_module<'ll>(
423424
"sign-return-address-with-bkey",
424425
u32::from(pac_opts.key == PAuthKey::B),
425426
);
427+
llvm::add_module_flag_u32(
428+
llmod,
429+
llvm::ModuleFlagMergeBehavior::Min,
430+
"guarded-control-stack",
431+
gcs.into(),
432+
);
426433
} else {
427434
bug!(
428435
"branch-protection used on non-AArch64 target; \

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use itertools::Itertools as _;
2-
use rustc_abi::{self as abi, FIRST_VARIANT};
2+
use rustc_abi::{self as abi, BackendRepr, FIRST_VARIANT};
33
use rustc_middle::ty::adjustment::PointerCoercion;
44
use rustc_middle::ty::layout::{HasTyCtxt, HasTypingEnv, LayoutOf, TyAndLayout};
55
use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
@@ -25,6 +25,15 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
2525
match *rvalue {
2626
mir::Rvalue::Use(ref operand) => {
2727
let cg_operand = self.codegen_operand(bx, operand);
28+
// Crucially, we do *not* use `OperandValue::Ref` for types with
29+
// `BackendRepr::Scalar | BackendRepr::ScalarPair`. This ensures we match the MIR
30+
// semantics regarding when assignment operators allow overlap of LHS and RHS.
31+
if matches!(
32+
cg_operand.layout.backend_repr,
33+
BackendRepr::Scalar(..) | BackendRepr::ScalarPair(..),
34+
) {
35+
debug_assert!(!matches!(cg_operand.val, OperandValue::Ref(..)));
36+
}
2837
// FIXME: consider not copying constants through stack. (Fixable by codegen'ing
2938
// constants into `OperandValue::Ref`; why don’t we do that yet if we don’t?)
3039
cg_operand.val.store(bx, dest);

compiler/rustc_const_eval/src/interpret/place.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ where
858858
/// Also, if you use this you are responsible for validating that things get copied at the
859859
/// right type.
860860
#[instrument(skip(self), level = "trace")]
861-
fn copy_op_no_validate(
861+
pub(super) fn copy_op_no_validate(
862862
&mut self,
863863
src: &impl Projectable<'tcx, M::Provenance>,
864864
dest: &impl Writeable<'tcx, M::Provenance>,

compiler/rustc_const_eval/src/interpret/step.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
310310
operands: &IndexSlice<FieldIdx, mir::Operand<'tcx>>,
311311
dest: &PlaceTy<'tcx, M::Provenance>,
312312
) -> InterpResult<'tcx> {
313-
self.write_uninit(dest)?; // make sure all the padding ends up as uninit
314313
let (variant_index, variant_dest, active_field_index) = match *kind {
315314
mir::AggregateKind::Adt(_, variant_index, _, _, active_field_index) => {
316315
let variant_dest = self.project_downcast(dest, variant_index)?;
@@ -346,9 +345,20 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
346345
let field_index = active_field_index.unwrap_or(field_index);
347346
let field_dest = self.project_field(&variant_dest, field_index)?;
348347
let op = self.eval_operand(operand, Some(field_dest.layout))?;
349-
self.copy_op(&op, &field_dest)?;
348+
// We validate manually below so we don't have to do it here.
349+
self.copy_op_no_validate(&op, &field_dest, /*allow_transmute*/ false)?;
350350
}
351-
self.write_discriminant(variant_index, dest)
351+
self.write_discriminant(variant_index, dest)?;
352+
// Validate that the entire thing is valid, and reset padding that might be in between the
353+
// fields.
354+
if M::enforce_validity(self, dest.layout()) {
355+
self.validate_operand(
356+
dest,
357+
M::enforce_validity_recursively(self, dest.layout()),
358+
/*reset_provenance_and_padding*/ true,
359+
)?;
360+
}
361+
interp_ok(())
352362
}
353363

354364
/// Repeats `operand` into the destination. `dest` must have array type, and that type

compiler/rustc_interface/src/tests.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,8 @@ fn test_unstable_options_tracking_hash() {
772772
branch_protection,
773773
Some(BranchProtection {
774774
bti: true,
775-
pac_ret: Some(PacRet { leaf: true, pc: true, key: PAuthKey::B })
775+
pac_ret: Some(PacRet { leaf: true, pc: true, key: PAuthKey::B }),
776+
gcs: true,
776777
})
777778
);
778779
tracked!(codegen_backend, Some("abc".to_string()));

compiler/rustc_middle/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ middle_failed_writing_file =
8484
# Note: We only mention patterns here since the error can only occur with references, and those
8585
# are forbidden in const generics.
8686
middle_invalid_const_in_valtree = constant {$global_const_id} cannot be used as pattern
87-
.note = constants that reference mutable or external memory cannot be used as pattern
87+
.note = constants that reference mutable or external memory cannot be used as patterns
8888
8989
middle_layout_cycle =
9090
a cycle occurred during layout computation

0 commit comments

Comments
 (0)