Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d2f21b8
Adds AArch64 GCS support
CrooseGit Sep 1, 2025
d80db5b
tests/codegen-llvm: Make rust-abi-arch-specific-adjustment portable
Gelbpunkt Sep 8, 2025
8ecda4b
interpret: fix overlapping aggregate initialization
RalfJung Sep 10, 2025
7222506
clarify current MIR semantics re: overlapping assignment
RalfJung Sep 10, 2025
16c7206
Note some previous attempts to change the Default impl for `[T; 0]`
Zalathar Sep 14, 2025
7791178
fix 404 link
luca3s Sep 14, 2025
ce859d7
Switch `std::vec::PeekMut::pop` from self to this parameter.
cammeresi Sep 14, 2025
572b423
On FreeBSD, use readdir instead of readdir_r
asomers Sep 14, 2025
927c4c0
Fix typo in error message
Jules-Bertholet Sep 14, 2025
b92ad97
bootstrap.py: disable incremental build for bootstrap in CI
lolbinarycat Sep 14, 2025
5ebdec5
rustc_codegen_llvm: Adjust RISC-V inline assembly's clobber list
a4lg Sep 15, 2025
8265748
opt-dist: don't set `RUST_LOG=collector=debug`
ognevny Sep 15, 2025
3a57d28
Extends branch protection tests to include GCS
CrooseGit Sep 2, 2025
dbb94e7
Updates arch64 llvm-19 CI to use GCC15
CrooseGit Sep 10, 2025
c92dee2
Add relnotes 1.90
BoxyUwU Sep 10, 2025
5c996db
Rollup merge of #146338 - CrooseGit:dev/reucru01/AArch64-enable-GCS, …
Zalathar Sep 15, 2025
bff91fa
Rollup merge of #146344 - Gelbpunkt:loongarch-codegen-llvm-test, r=Ma…
Zalathar Sep 15, 2025
824a4fd
Rollup merge of #146402 - RalfJung:aggregate-init, r=saethlin
Zalathar Sep 15, 2025
c03ae31
Rollup merge of #146405 - BoxyUwU:relnotes_1_90, r=Mark-Simulacrum
Zalathar Sep 15, 2025
7ca78d8
Rollup merge of #146530 - a4lg:riscv-inline-asm-default-clobber-float…
Zalathar Sep 15, 2025
bd7a460
Rollup merge of #146533 - Zalathar:array-default, r=compiler-errors
Zalathar Sep 15, 2025
a2203fa
Rollup merge of #146539 - luca3s:push-xuwtvwrsspnp, r=jieyouxu
Zalathar Sep 15, 2025
7fee0d0
Rollup merge of #146546 - cammeresi:pop, r=Mark-Simulacrum
Zalathar Sep 15, 2025
5d9880a
Rollup merge of #146549 - asomers:freebsd-readdir, r=Mark-Simulacrum
Zalathar Sep 15, 2025
d96ff69
Rollup merge of #146559 - Jules-Bertholet:fix-typo, r=nnethercote
Zalathar Sep 15, 2025
5e49214
Rollup merge of #146563 - lolbinarycat:bootstrap-ci-no-incremental, r…
Zalathar Sep 15, 2025
6058efe
Rollup merge of #146576 - ognevny:opt-dist-collector-logs, r=Kobzol
Zalathar Sep 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ Shohei Wada <[email protected]>
Shotaro Yamada <[email protected]>
Shotaro Yamada <[email protected]> <[email protected]>
Shyam Sundar B <[email protected]>
Sidney Cammeresi <[email protected]> <[email protected]>
Simon Barber-Dueck <[email protected]> Simon BD <simon@server>
Simon Sapin <[email protected]> <[email protected]>
Simonas Kazlauskas <[email protected]> Simonas Kazlauskas <[email protected]>
Expand Down
126 changes: 126 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,129 @@
Version 1.90 (2025-09-18)
==========================

<a id="1.90-Language"></a>

Language
--------
- [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:
1. `unknown_diagnostic_attributes`: unknown to the current compiler
2. `misplaced_diagnostic_attributes`: placed on the wrong item
3. `malformed_diagnostic_attributes`: malformed attribute syntax or options
4. `malformed_diagnostic_format_literals`: malformed format string literal
- [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)
- [Allow volatile access to non-Rust memory, including address 0](https://github.com/rust-lang/rust/pull/141260)


<a id="1.90-Compiler"></a>

Compiler
--------
- [Use `lld` by default on `x86_64-unknown-linux-gnu`](https://github.com/rust-lang/rust/pull/140525).
- [Tier 3 `musl` targets now link dynamically by default](https://github.com/rust-lang/rust/pull/144410). Affected targets:
- `mips64-unknown-linux-muslabi64`
- `powerpc64-unknown-linux-musl`
- `powerpc-unknown-linux-musl`
- `powerpc-unknown-linux-muslspe`
- `riscv32gc-unknown-linux-musl`
- `s390x-unknown-linux-musl`
- `thumbv7neon-unknown-linux-musleabihf`


<a id="1.90-Platform-Support"></a>

Platform Support
----------------
- [Demote `x86_64-apple-darwin` to Tier 2 with host tools](https://github.com/rust-lang/rust/pull/145252)


Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

[platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html

<a id="1.90-Libraries"></a>

Libraries
---------
- [Stabilize `u*::{checked,overflowing,saturating,wrapping}_sub_signed`](https://github.com/rust-lang/rust/issues/126043)
- [Allow comparisons between `CStr`, `CString`, and `Cow<CStr>`](https://github.com/rust-lang/rust/pull/137268)
- [Remove some unsized tuple impls since unsized tuples can't be constructed](https://github.com/rust-lang/rust/pull/138340)
- [Set `MSG_NOSIGNAL` for `UnixStream`](https://github.com/rust-lang/rust/pull/140005)
- [`proc_macro::Ident::new` now supports `$crate`.](https://github.com/rust-lang/rust/pull/141996)
- [Guarantee the pointer returned from `Thread::into_raw` has at least 8 bytes of alignment](https://github.com/rust-lang/rust/pull/143859)


<a id="1.90-Stabilized-APIs"></a>

Stabilized APIs
---------------

- [`u{n}::checked_sub_signed`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.checked_sub_signed)
- [`u{n}::overflowing_sub_signed`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.overflowing_sub_signed)
- [`u{n}::saturating_sub_signed`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.saturating_sub_signed)
- [`u{n}::wrapping_sub_signed`](https://doc.rust-lang.org/stable/std/primitive.usize.html#method.wrapping_sub_signed)
- [`impl Copy for IntErrorKind`](https://doc.rust-lang.org/stable/std/num/enum.IntErrorKind.html#impl-Copy-for-IntErrorKind)
- [`impl Hash for IntErrorKind`](https://doc.rust-lang.org/stable/std/num/enum.IntErrorKind.html#impl-Hash-for-IntErrorKind)
- [`impl PartialEq<&CStr> for CStr`](https://doc.rust-lang.org/stable/std/ffi/struct.CStr.html#impl-PartialEq%3C%26CStr%3E-for-CStr)
- [`impl PartialEq<CString> for CStr`](https://doc.rust-lang.org/stable/std/ffi/struct.CStr.html#impl-PartialEq%3CCString%3E-for-CStr)
- [`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)
- [`impl PartialEq<&CStr> for CString`](https://doc.rust-lang.org/stable/std/ffi/struct.CString.html#impl-PartialEq%3C%26CStr%3E-for-CString)
- [`impl PartialEq<CStr> for CString`](https://doc.rust-lang.org/stable/std/ffi/struct.CString.html#impl-PartialEq%3CCStr%3E-for-CString)
- [`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)
- [`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)
- [`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)
- [`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)


These previously stable APIs are now stable in const contexts:

- [`<[T]>::reverse`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.reverse)
- [`f32::floor`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.floor)
- [`f32::ceil`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.ceil)
- [`f32::trunc`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.trunc)
- [`f32::fract`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.fract)
- [`f32::round`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.round)
- [`f32::round_ties_even`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.round_ties_even)
- [`f64::floor`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.floor)
- [`f64::ceil`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.ceil)
- [`f64::trunc`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.trunc)
- [`f64::fract`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.fract)
- [`f64::round`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.round)
- [`f64::round_ties_even`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.round_ties_even)


<a id="1.90-Cargo"></a>

Cargo
-----
- [Add `http.proxy-cainfo` config for proxy certs](https://github.com/rust-lang/cargo/pull/15374/)
- [Use `gix` for `cargo package`](https://github.com/rust-lang/cargo/pull/15534/)
- [feat(publish): Stabilize multi-package publishing](https://github.com/rust-lang/cargo/pull/15636/)

<a id="1.90-Rustdoc"></a>

Rustdoc
-----
- [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
- [Display unsafe attributes with `unsafe()` wrappers](https://github.com/rust-lang/rust/pull/143662)


<a id="1.90-Compatibility-Notes"></a>

Compatibility Notes
-------------------
- [Use `lld` by default on `x86_64-unknown-linux-gnu`](https://github.com/rust-lang/rust/pull/140525).
See also <https://blog.rust-lang.org/2025/09/01/rust-lld-on-1.90.0-stable/>.
- [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)
- [Set `MSG_NOSIGNAL` for `UnixStream`](https://github.com/rust-lang/rust/pull/140005)
This may change program behavior but results in the same behavior as other primitives (e.g., stdout, network sockets).
Programs relying on signals to terminate them should update handling of sockets to handle errors on write by exiting.
- [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)
- 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.
- [const-eval: error when initializing a static writes to that static](https://github.com/rust-lang/rust/pull/143084)
- [Check that the `proc_macro_derive` macro has correct arguments when applied to the crate root](https://github.com/rust-lang/rust/pull/143607)


Version 1.89.0 (2025-08-07)
==========================

Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_llvm/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
}
InlineAsmArch::RiscV32 | InlineAsmArch::RiscV64 => {
constraints.extend_from_slice(&[
"~{fflags}".to_string(),
"~{vtype}".to_string(),
"~{vl}".to_string(),
"~{vxsat}".to_string(),
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_codegen_llvm/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,16 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
to_add.extend(sanitize_attrs(cx, codegen_fn_attrs.no_sanitize));

// For non-naked functions, set branch protection attributes on aarch64.
if let Some(BranchProtection { bti, pac_ret }) =
if let Some(BranchProtection { bti, pac_ret, gcs }) =
cx.sess().opts.unstable_opts.branch_protection
{
assert!(cx.sess().target.arch == "aarch64");
if bti {
to_add.push(llvm::CreateAttrString(cx.llcx, "branch-target-enforcement"));
}
if gcs {
to_add.push(llvm::CreateAttrString(cx.llcx, "guarded-control-stack"));
}
if let Some(PacRet { leaf, pc, key }) = pac_ret {
if pc {
to_add.push(llvm::CreateAttrString(cx.llcx, "branch-protection-pauth-lr"));
Expand Down
9 changes: 8 additions & 1 deletion compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ pub(crate) unsafe fn create_module<'ll>(
);
}

if let Some(BranchProtection { bti, pac_ret }) = sess.opts.unstable_opts.branch_protection {
if let Some(BranchProtection { bti, pac_ret, gcs }) = sess.opts.unstable_opts.branch_protection
{
if sess.target.arch == "aarch64" {
llvm::add_module_flag_u32(
llmod,
Expand Down Expand Up @@ -423,6 +424,12 @@ pub(crate) unsafe fn create_module<'ll>(
"sign-return-address-with-bkey",
u32::from(pac_opts.key == PAuthKey::B),
);
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Min,
"guarded-control-stack",
gcs.into(),
);
} else {
bug!(
"branch-protection used on non-AArch64 target; \
Expand Down
11 changes: 10 additions & 1 deletion compiler/rustc_codegen_ssa/src/mir/rvalue.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use itertools::Itertools as _;
use rustc_abi::{self as abi, FIRST_VARIANT};
use rustc_abi::{self as abi, BackendRepr, FIRST_VARIANT};
use rustc_middle::ty::adjustment::PointerCoercion;
use rustc_middle::ty::layout::{HasTyCtxt, HasTypingEnv, LayoutOf, TyAndLayout};
use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
Expand All @@ -25,6 +25,15 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
match *rvalue {
mir::Rvalue::Use(ref operand) => {
let cg_operand = self.codegen_operand(bx, operand);
// Crucially, we do *not* use `OperandValue::Ref` for types with
// `BackendRepr::Scalar | BackendRepr::ScalarPair`. This ensures we match the MIR
// semantics regarding when assignment operators allow overlap of LHS and RHS.
if matches!(
cg_operand.layout.backend_repr,
BackendRepr::Scalar(..) | BackendRepr::ScalarPair(..),
) {
debug_assert!(!matches!(cg_operand.val, OperandValue::Ref(..)));
}
// FIXME: consider not copying constants through stack. (Fixable by codegen'ing
// constants into `OperandValue::Ref`; why don’t we do that yet if we don’t?)
cg_operand.val.store(bx, dest);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/interpret/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ where
/// Also, if you use this you are responsible for validating that things get copied at the
/// right type.
#[instrument(skip(self), level = "trace")]
fn copy_op_no_validate(
pub(super) fn copy_op_no_validate(
&mut self,
src: &impl Projectable<'tcx, M::Provenance>,
dest: &impl Writeable<'tcx, M::Provenance>,
Expand Down
16 changes: 13 additions & 3 deletions compiler/rustc_const_eval/src/interpret/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
operands: &IndexSlice<FieldIdx, mir::Operand<'tcx>>,
dest: &PlaceTy<'tcx, M::Provenance>,
) -> InterpResult<'tcx> {
self.write_uninit(dest)?; // make sure all the padding ends up as uninit
let (variant_index, variant_dest, active_field_index) = match *kind {
mir::AggregateKind::Adt(_, variant_index, _, _, active_field_index) => {
let variant_dest = self.project_downcast(dest, variant_index)?;
Expand Down Expand Up @@ -346,9 +345,20 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
let field_index = active_field_index.unwrap_or(field_index);
let field_dest = self.project_field(&variant_dest, field_index)?;
let op = self.eval_operand(operand, Some(field_dest.layout))?;
self.copy_op(&op, &field_dest)?;
// We validate manually below so we don't have to do it here.
self.copy_op_no_validate(&op, &field_dest, /*allow_transmute*/ false)?;
}
self.write_discriminant(variant_index, dest)
self.write_discriminant(variant_index, dest)?;
// Validate that the entire thing is valid, and reset padding that might be in between the
// fields.
if M::enforce_validity(self, dest.layout()) {
self.validate_operand(
dest,
M::enforce_validity_recursively(self, dest.layout()),
/*reset_provenance_and_padding*/ true,
)?;
}
interp_ok(())
}

/// Repeats `operand` into the destination. `dest` must have array type, and that type
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,8 @@ fn test_unstable_options_tracking_hash() {
branch_protection,
Some(BranchProtection {
bti: true,
pac_ret: Some(PacRet { leaf: true, pc: true, key: PAuthKey::B })
pac_ret: Some(PacRet { leaf: true, pc: true, key: PAuthKey::B }),
gcs: true,
})
);
tracked!(codegen_backend, Some("abc".to_string()));
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ middle_failed_writing_file =
# Note: We only mention patterns here since the error can only occur with references, and those
# are forbidden in const generics.
middle_invalid_const_in_valtree = constant {$global_const_id} cannot be used as pattern
.note = constants that reference mutable or external memory cannot be used as pattern
.note = constants that reference mutable or external memory cannot be used as patterns

middle_layout_cycle =
a cycle occurred during layout computation
Expand Down
8 changes: 5 additions & 3 deletions compiler/rustc_middle/src/mir/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,11 @@ pub enum StatementKind<'tcx> {
/// interesting for optimizations? Do we want to allow such optimizations?
///
/// **Needs clarification**: We currently require that the LHS place not overlap with any place
/// read as part of computation of the RHS for some rvalues (generally those not producing
/// primitives). This requirement is under discussion in [#68364]. As a part of this discussion,
/// it is also unclear in what order the components are evaluated.
/// read as part of computation of the RHS for some rvalues. This requirement is under
/// discussion in [#68364]. Specifically, overlap is permitted only for assignments of a type
/// with `BackendRepr::Scalar | BackendRepr::ScalarPair` where all the scalar fields are
/// [`Scalar::Initialized`][rustc_abi::Scalar::Initialized]. As a part of this discussion, it is
/// also unclear in what order the components are evaluated.
///
/// [#68364]: https://github.com/rust-lang/rust/issues/68364
///
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1615,6 +1615,7 @@ pub struct PacRet {
pub struct BranchProtection {
pub bti: bool,
pub pac_ret: Option<PacRet>,
pub gcs: bool,
}

pub(crate) const fn default_lib_output() -> CrateType {
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ mod desc {
pub(crate) const parse_polonius: &str = "either no value or `legacy` (the default), or `next`";
pub(crate) const parse_stack_protector: &str =
"one of (`none` (default), `basic`, `strong`, or `all`)";
pub(crate) const parse_branch_protection: &str = "a `,` separated combination of `bti`, `pac-ret`, followed by a combination of `pc`, `b-key`, or `leaf`";
pub(crate) const parse_branch_protection: &str = "a `,` separated combination of `bti`, `gcs`, `pac-ret`, (optionally with `pc`, `b-key`, `leaf` if `pac-ret` is set)";
pub(crate) const parse_proc_macro_execution_strategy: &str =
"one of supported execution strategies (`same-thread`, or `cross-thread`)";
pub(crate) const parse_remap_path_scope: &str =
Expand Down Expand Up @@ -1903,6 +1903,7 @@ pub mod parse {
Some(pac) => pac.pc = true,
_ => return false,
},
"gcs" => slot.gcs = true,
_ => return false,
};
}
Expand Down
4 changes: 2 additions & 2 deletions library/alloc/src/vec/peek_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ impl<'a, T> PeekMut<'a, T> {

/// Removes the peeked value from the vector and returns it.
#[unstable(feature = "vec_peek_mut", issue = "122742")]
pub fn pop(self) -> T {
pub fn pop(this: Self) -> T {
// SAFETY: PeekMut is only constructed if the vec is non-empty
unsafe { self.vec.pop().unwrap_unchecked() }
unsafe { this.vec.pop().unwrap_unchecked() }
}
}

Expand Down
4 changes: 2 additions & 2 deletions library/alloctests/tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::ops::Bound::*;
use std::panic::{AssertUnwindSafe, catch_unwind};
use std::rc::Rc;
use std::sync::atomic::{AtomicU32, Ordering};
use std::vec::{Drain, IntoIter};
use std::vec::{Drain, IntoIter, PeekMut};

use crate::testing::macros::struct_with_counted_drop;

Expand Down Expand Up @@ -2647,7 +2647,7 @@ fn test_peek_mut() {
assert_eq!(*p, 2);
*p = 0;
assert_eq!(*p, 0);
p.pop();
PeekMut::pop(p);
assert_eq!(vec.len(), 1);
} else {
unreachable!()
Expand Down
5 changes: 5 additions & 0 deletions library/core/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,11 @@ impl<T: Copy> SpecArrayClone for T {
// The Default impls cannot be done with const generics because `[T; 0]` doesn't
// require Default to be implemented, and having different impl blocks for
// different numbers isn't supported yet.
//
// Trying to improve the `[T; 0]` situation has proven to be difficult.
// Please see these issues for more context on past attempts and crater runs:
// - https://github.com/rust-lang/rust/issues/61415
// - https://github.com/rust-lang/rust/pull/145457

macro_rules! array_impl_default {
{$n:expr, $t:ident $($ts:ident)*} => {
Expand Down
Loading
Loading