Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
44d6cd2
Fix environ on FreeBSD with cdylib targets that use -Wl,--no-undefined .
asomers Mar 5, 2026
d2e3ab6
std: move `sys::pal::os` to `sys::paths` (rename/delete only)
joboet Mar 9, 2026
f4a95d3
std: move leftover Windows error test
joboet Mar 9, 2026
be5f070
std: move `sys::pal::os` to `sys::paths`
joboet Mar 9, 2026
0e0babc
docs(fs): Clarify that File::lock coordinates across processes
TKanX Mar 10, 2026
e108da9
`std`: include `dlmalloc` for all non-wasi Wasm targets
Twey Mar 11, 2026
e2923eb
`std`: don't depend on `dlmalloc` when `cfg(unix)`
Twey Mar 11, 2026
425df0d
Do not emit separator as before elements
zakarumych Feb 19, 2026
800d9ea
Lifted intersperse and intersperse_with Fused restrictions and update…
asder8215 Mar 14, 2026
a893257
remove usages of to-be-deprecated numeric constants
cyrgani Mar 15, 2026
cab72ae
implement `BinaryHeap::as_mut_slice`
usamoi Mar 17, 2026
577dba9
Skip stack_start_aligned for immediate-abort
danielzgtg Mar 16, 2026
9b7dff9
Move and rename LTO-specific test files from tests/ui/issues/ to test…
ujjwalvishwakarma2006 Mar 21, 2026
dd2b208
Add comment at the top in two test files referencing the issue they o…
ujjwalvishwakarma2006 Mar 22, 2026
6458ca5
Unknown -> Unsupported compression algorithm
Mark-Simulacrum Jan 2, 2026
331d5dc
Rollup merge of #153686 - Twey:patch-1, r=Mark-Simulacrum
JonathanBrouwer Mar 22, 2026
b945a80
Rollup merge of #153718 - asomers:environ-freebsd, r=Mark-Simulacrum
JonathanBrouwer Mar 22, 2026
b48d3c7
Rollup merge of #153880 - asder8215:intersperse_nonfused, r=Mark-Simu…
JonathanBrouwer Mar 22, 2026
fbaafdc
Rollup merge of #153931 - cyrgani:old-consts, r=Mark-Simulacrum
JonathanBrouwer Mar 22, 2026
b5d5e8c
Rollup merge of #150630 - Mark-Simulacrum:rephrase-compression-warn, …
JonathanBrouwer Mar 22, 2026
e211661
Rollup merge of #153623 - joboet:move_pal_os, r=Mark-Simulacrum
JonathanBrouwer Mar 22, 2026
4bbda40
Rollup merge of #153647 - TKanX:docs/153618-file-lock-cross-process, …
JonathanBrouwer Mar 22, 2026
473e7fe
Rollup merge of #153936 - danielzgtg:perf/immediateAbortAvoidPthreadG…
JonathanBrouwer Mar 22, 2026
3db6a12
Rollup merge of #154011 - usamoi:binary_heap_as_mut_slice, r=Mark-Sim…
JonathanBrouwer Mar 22, 2026
d790229
Rollup merge of #154167 - ujjwalvishwakarma2006:move-lto-tests, r=Kiv…
JonathanBrouwer Mar 22, 2026
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
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use crate::builder::gpu_offload::scalar_width;
use crate::common::AsCCharPtr;
use crate::errors::{
CopyBitcode, FromLlvmDiag, FromLlvmOptimizationDiag, LlvmError, ParseTargetMachineConfig,
UnknownCompression, WithLlvmError, WriteBytecode,
UnsupportedCompression, WithLlvmError, WriteBytecode,
};
use crate::llvm::diagnostic::OptimizationDiagnosticKind::*;
use crate::llvm::{self, DiagnosticInfo};
Expand Down Expand Up @@ -248,15 +248,15 @@ pub(crate) fn target_machine_factory(
if llvm::LLVMRustLLVMHasZlibCompression() {
llvm::CompressionKind::Zlib
} else {
sess.dcx().emit_warn(UnknownCompression { algorithm: "zlib" });
sess.dcx().emit_warn(UnsupportedCompression { algorithm: "zlib" });
llvm::CompressionKind::None
}
}
config::DebugInfoCompression::Zstd => {
if llvm::LLVMRustLLVMHasZstdCompression() {
llvm::CompressionKind::Zstd
} else {
sess.dcx().emit_warn(UnknownCompression { algorithm: "zstd" });
sess.dcx().emit_warn(UnsupportedCompression { algorithm: "zstd" });
llvm::CompressionKind::None
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ pub(crate) struct CopyBitcode {

#[derive(Diagnostic)]
#[diag(
"unknown debuginfo compression algorithm {$algorithm} - will fall back to uncompressed debuginfo"
"unsupported debuginfo compression algorithm {$algorithm} - will fall back to uncompressed debuginfo"
)]
pub(crate) struct UnknownCompression {
pub(crate) struct UnsupportedCompression {
pub algorithm: &'static str,
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/dep_graph/serialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use std::cell::RefCell;
use std::cmp::max;
use std::sync::Arc;
use std::sync::atomic::Ordering;
use std::{iter, mem, u64};
use std::{iter, mem};

use rustc_data_structures::fingerprint::{Fingerprint, PackedFingerprint};
use rustc_data_structures::fx::FxHashMap;
Expand Down
31 changes: 31 additions & 0 deletions library/alloc/src/collections/binary_heap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,37 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
self.data.as_slice()
}

/// Returns a mutable slice of all values in the underlying vector.
///
/// # Safety
///
/// The caller must ensure that the slice remains a max-heap, i.e. for all indices
/// `0 < i < slice.len()`, `slice[(i - 1) / 2] >= slice[i]`, before the borrow ends
/// and the binary heap is used.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// #![feature(binary_heap_as_mut_slice)]
///
/// use std::collections::BinaryHeap;
///
/// let mut heap = BinaryHeap::<u32>::from([1, 2, 3, 4, 5, 6, 7]);
///
/// unsafe {
/// for value in heap.as_mut_slice() {
/// *value = (*value).saturating_mul(2);
/// }
/// }
/// ```
#[must_use]
#[unstable(feature = "binary_heap_as_mut_slice", issue = "154009")]
pub unsafe fn as_mut_slice(&mut self) -> &mut [T] {
self.data.as_mut_slice()
}

/// Consumes the `BinaryHeap` and returns the underlying vector
/// in arbitrary order.
///
Expand Down
35 changes: 10 additions & 25 deletions library/core/src/iter/adapters/intersperse.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::fmt;
use crate::iter::{Fuse, FusedIterator};

/// An iterator adapter that places a separator between all elements.
///
Expand All @@ -14,23 +13,15 @@ where
started: bool,
separator: I::Item,
next_item: Option<I::Item>,
iter: Fuse<I>,
}

#[unstable(feature = "iter_intersperse", issue = "79524")]
impl<I> FusedIterator for Intersperse<I>
where
I: FusedIterator,
I::Item: Clone,
{
iter: I,
}

impl<I: Iterator> Intersperse<I>
where
I::Item: Clone,
{
pub(in crate::iter) fn new(iter: I, separator: I::Item) -> Self {
Self { started: false, separator, next_item: None, iter: iter.fuse() }
Self { started: false, separator, next_item: None, iter }
}
}

Expand All @@ -57,8 +48,9 @@ where
}
}
} else {
self.started = true;
self.iter.next()
let item = self.iter.next();
self.started = item.is_some();
item
}
}

Expand Down Expand Up @@ -95,15 +87,7 @@ where
started: bool,
separator: G,
next_item: Option<I::Item>,
iter: Fuse<I>,
}

#[unstable(feature = "iter_intersperse", issue = "79524")]
impl<I, G> FusedIterator for IntersperseWith<I, G>
where
I: FusedIterator,
G: FnMut() -> I::Item,
{
iter: I,
}

#[unstable(feature = "iter_intersperse", issue = "79524")]
Expand Down Expand Up @@ -146,7 +130,7 @@ where
G: FnMut() -> I::Item,
{
pub(in crate::iter) fn new(iter: I, separator: G) -> Self {
Self { started: false, separator, next_item: None, iter: iter.fuse() }
Self { started: false, separator, next_item: None, iter }
}
}

Expand All @@ -173,8 +157,9 @@ where
}
}
} else {
self.started = true;
self.iter.next()
let item = self.iter.next();
self.started = item.is_some();
item
}
}

Expand Down
44 changes: 35 additions & 9 deletions library/core/src/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,11 +635,24 @@ pub const trait Iterator {
/// of the original iterator.
///
/// Specifically on fused iterators, it is guaranteed that the new iterator
/// places a copy of `separator` between adjacent `Some(_)` items. However,
/// for non-fused iterators, [`intersperse`] will create a new iterator that
/// is a fused version of the original iterator and place a copy of `separator`
/// between adjacent `Some(_)` items. This behavior for non-fused iterators
/// is subject to change.
/// places a copy of `separator` between *adjacent* `Some(_)` items. For non-fused iterators,
/// it is guaranteed that [`intersperse`] will create a new iterator that places a copy
/// of `separator` between `Some(_)` items, particularly just right before the subsequent
/// `Some(_)` item.
///
/// For example, consider the following non-fused iterator:
///
/// ```text
/// Some(1) -> Some(2) -> None -> Some(3) -> Some(4) -> ...
/// ```
///
/// If this non-fused iterator were to be interspersed with `0`,
/// then the interspersed iterator will produce:
///
/// ```text
/// Some(1) -> Some(0) -> Some(2) -> None -> Some(0) -> Some(3) -> Some(0) ->
/// Some(4) -> ...
/// ```
///
/// In case `separator` does not implement [`Clone`] or needs to be
/// computed every time, use [`intersperse_with`].
Expand Down Expand Up @@ -688,10 +701,23 @@ pub const trait Iterator {
///
/// Specifically on fused iterators, it is guaranteed that the new iterator
/// places an item generated by `separator` between adjacent `Some(_)` items.
/// However, for non-fused iterators, [`intersperse_with`] will create a new
/// iterator that is a fused version of the original iterator and place an item
/// generated by `separator` between adjacent `Some(_)` items. This
/// behavior for non-fused iterators is subject to change.
/// For non-fused iterators, it is guaranteed that [`intersperse_with`] will
/// create a new iterator that places an item generated by `separator` between `Some(_)`
/// items, particularly just right before the subsequent `Some(_)` item.
///
/// For example, consider the following non-fused iterator:
///
/// ```text
/// Some(1) -> Some(2) -> None -> Some(3) -> Some(4) -> ...
/// ```
///
/// If this non-fused iterator were to be interspersed with a `separator` closure
/// that returns `0` repeatedly, the interspersed iterator will produce:
///
/// ```text
/// Some(1) -> Some(0) -> Some(2) -> None -> Some(0) -> Some(3) -> Some(0) ->
/// Some(4) -> ...
/// ```
///
/// The `separator` closure will be called exactly once each time an item
/// is placed between two adjacent items from the underlying iterator;
Expand Down
2 changes: 1 addition & 1 deletion library/coretests/tests/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ fn array_mixed_equality_integers() {

#[test]
fn array_mixed_equality_nans() {
let array3: [f32; 3] = [1.0, std::f32::NAN, 3.0];
let array3: [f32; 3] = [1.0, f32::NAN, 3.0];

let slice3: &[f32] = &{ array3 };
assert!(!(array3 == slice3));
Expand Down
Loading
Loading