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
f7d8e4a
Remove the label starting with 0 in the test binary_asm_labels_allowe…
antoyo Oct 17, 2026
4477617
Document allocator swap in BinaryHeap::append
whiplashvin Oct 26, 2026
7b1da71
Apply review suggestion for BinaryHeap::append docs
whiplashvin Oct 27, 2026
20ae3b6
std: Add UI tests for feature detection macros
tgross35 Oct 26, 2026
030cab2
std: Improve multi-line compile errors from `std_detect`
tgross35 Oct 26, 2026
7bc50e7
std: Remove unneeded gates from `std_detect`
tgross35 Oct 22, 2026
51ff312
std: Add more documentation to the `std_detect` macros
tgross35 Oct 27, 2026
5f7505c
std: Simplify std_detect feature iteraion using a list
tgross35 Oct 27, 2026
63f2b39
Fix constant-pattern suggestion spans in macros
pkondzior Nov 1, 2026
34c44aa
Fix explicit destructor-call suggestion spans in macros
pkondzior Nov 2, 2026
f6db665
impl_from_endian_bytes for f16 and f128
valaphee Nov 2, 2026
ce9a827
fmt
valaphee Nov 2, 2026
d239ae1
add f16, f128 feature
valaphee Nov 2, 2026
8d41583
remove unusued query key impl
bit-aloo Nov 3, 2026
0a75b4c
docker: bump node to v24.22.2 in shared script
ubiratansoares Nov 3, 2026
0376ed9
[Outreachy] alloc: Add test coverage for try_clone_from_ref_in (Box, …
Joiejoie1 Nov 4, 2026
c64f52f
Rollup merge of #165011 - tgross35:std_detect-updates, r=LawnGnome
Zalathar Nov 4, 2026
b391883
Rollup merge of #164482 - antoyo:fix/aarch64-label-gnu-as, r=tgross35
Zalathar Nov 4, 2026
7b993ca
Rollup merge of #165268 - pkondzior:fix-164044-main, r=estebank
Zalathar Nov 4, 2026
ab3e91f
Rollup merge of #165318 - pkondzior:fix-164044-explicit-destructor-ca…
Zalathar Nov 4, 2026
25ffaae
Rollup merge of #164440 - Joiejoie1:test-try-clone-from-ref-in, r=nia-e
Zalathar Nov 4, 2026
257da0b
Rollup merge of #165001 - whiplashvin:binary-heap-append-allocator-do…
Zalathar Nov 4, 2026
8ab7eb6
Rollup merge of #165330 - valaphee:read_f16_f128, r=LawnGnome
Zalathar Nov 4, 2026
3b51c82
Rollup merge of #165414 - bit-aloo:2026-11-03-remove-unused-querykey-…
Zalathar Nov 4, 2026
4f15142
Rollup merge of #165440 - ubiratansoares:u/bump-node-24.22.x, r=jieyouxu
Zalathar Nov 4, 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
16 changes: 9 additions & 7 deletions compiler/rustc_hir_typeck/src/callee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ pub(crate) fn check_legal_trait_for_method_call(
// Allow calling `Drop::pin_drop` in `Drop::drop`
&& !tcx.is_lang_item(tcx.parent(body_def_id), LangItem::Drop)
{
let sugg = if let Some(receiver) = receiver.filter(|s| !s.is_empty()) {
diagnostics::ExplicitDestructorCallSugg::Snippet {
lo: expr_span.shrink_to_lo().to(receiver.shrink_to_lo()),
hi: receiver.shrink_to_hi().to(expr_span.shrink_to_hi()),
}
} else {
diagnostics::ExplicitDestructorCallSugg::Empty(span)
let sugg = match receiver.filter(|s| !s.is_empty()) {
Some(receiver) => receiver
.find_ancestor_inside_same_ctxt(expr_span)
.filter(|receiver| !receiver.is_empty())
.map(|receiver| diagnostics::ExplicitDestructorCallSugg::Snippet {
lo: expr_span.shrink_to_lo().to(receiver.shrink_to_lo()),
hi: receiver.shrink_to_hi().to(expr_span.shrink_to_hi()),
}),
None => Some(diagnostics::ExplicitDestructorCallSugg::Empty(span)),
};
return Err(tcx.dcx().emit_err(diagnostics::ExplicitDestructorCall { span, sugg }));
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ pub(crate) struct ExplicitDestructorCall {
#[label("explicit destructor calls not allowed")]
pub span: Span,
#[subdiagnostic]
pub sugg: ExplicitDestructorCallSugg,
pub sugg: Option<ExplicitDestructorCallSugg>,
}

#[derive(Subdiagnostic)]
Expand Down
18 changes: 0 additions & 18 deletions compiler/rustc_middle/src/query/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,24 +346,6 @@ impl<'tcx, T: QueryKeyBounds> QueryKey for (CanonicalQueryInput<'tcx, T>, bool)
}
}

impl<'tcx, T: QueryKeyBounds> QueryKey for (CanonicalQueryInput<'tcx, T>, usize) {
fn default_span(&self, _tcx: TyCtxt<'_>) -> Span {
DUMMY_SP
}
}

impl<'tcx> QueryKey for crate::traits::solve::CanonicalInput<'tcx> {
fn default_span(&self, _tcx: TyCtxt<'_>) -> Span {
DUMMY_SP
}
}

impl<'tcx> QueryKey for (crate::traits::solve::CanonicalInput<'tcx>, bool) {
fn default_span(&self, _tcx: TyCtxt<'_>) -> Span {
DUMMY_SP
}
}

impl<'tcx> QueryKey for (crate::traits::solve::CanonicalInput<'tcx>, usize) {
fn default_span(&self, _tcx: TyCtxt<'_>) -> Span {
DUMMY_SP
Expand Down
7 changes: 5 additions & 2 deletions compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,12 @@ impl<'tcx> ConstToPat<'tcx> {
}) => {
if let_expr.pat.span == self.span {
// `if let CONST = expr` -> `if CONST == expr`.
Some(SuggestEq::ReplaceWithEq {
let matching_initializer =
let_expr.init.span.find_ancestor_in_same_ctxt(self.span);

matching_initializer.map(|init_span| SuggestEq::ReplaceWithEq {
removal: span.until(self.span),
eq: self.span.between(let_expr.init.span),
eq: self.span.between(init_span),
ty,
manual_partialeq_impl,
})
Expand Down
2 changes: 2 additions & 0 deletions library/alloc/src/collections/binary_heap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,8 @@ impl<T: Ord, A: Allocator> BinaryHeap<T, A> {

/// Moves all the elements of `other` into `self`, leaving `other` empty.
///
/// For performance, `self` and `other` may be swapped before appending.
///
/// # Examples
///
/// Basic usage:
Expand Down
4 changes: 3 additions & 1 deletion library/alloc/src/io/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1108,4 +1108,6 @@ macro_rules! impl_from_endian_bytes {
)*};
}

impl_from_endian_bytes!(u8, u16, u32, u64, u128, usize, i8, i16, i32, i64, i128, isize, f32, f64);
impl_from_endian_bytes!(
u8, u16, u32, u64, u128, usize, i8, i16, i32, i64, i128, isize, f16, f32, f64, f128
);
2 changes: 2 additions & 0 deletions library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@
#![feature(coroutine_trait)]
#![feature(decl_macro)]
#![feature(dropck_eyepatch)]
#![feature(f16)]
#![feature(f128)]
#![feature(fundamental)]
#![feature(impl_restriction)]
#![feature(intrinsics)]
Expand Down
28 changes: 28 additions & 0 deletions library/alloctests/tests/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,34 @@ use core::cell::Cell;
use core::mem::MaybeUninit;
use core::ptr::NonNull;

#[test]
fn try_clone_from_ref_in_zero_sized_type_skips_allocation() {
use std::alloc::Global;

struct CountingAllocator {
allocations: Cell<usize>,
}

unsafe impl Allocator for CountingAllocator {
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
self.allocations.set(self.allocations.get() + 1);
Global.allocate(layout)
}

unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) {
unsafe { Global.deallocate(ptr, layout) }
}
}

let alloc = CountingAllocator { allocations: Cell::new(0) };

let value = ();
let boxed = Box::try_clone_from_ref_in(&value, &alloc).unwrap();

assert_eq!(*boxed, ());
assert_eq!(alloc.allocations.get(), 0);
}

#[test]
#[expect(dangling_pointers_from_temporaries)]
fn uninitialized_zero_size_box() {
Expand Down
1 change: 1 addition & 0 deletions library/alloctests/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#![feature(byte_str_to_string)]
#![feature(can_vector)]
#![feature(casefold)]
#![feature(clone_from_ref)]
#![feature(const_cmp)]
#![feature(const_heap)]
#![feature(const_trait_impl)]
Expand Down
39 changes: 20 additions & 19 deletions library/std_detect/src/detect/arch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,40 @@ mod s390x;

cfg_select! {
any(target_arch = "x86", target_arch = "x86_64") => {
#[stable(feature = "simd_x86", since = "1.27.0")]
pub use x86::*;
pub use x86::__is_feature_detected;
pub(crate) use x86::Feature;
}
target_arch = "arm" => {
#[unstable(feature = "stdarch_arm_feature_detection", issue = "111190")]
pub use arm::*;
pub use arm::__is_feature_detected;
pub(crate) use arm::Feature;
}
any(target_arch = "aarch64", target_arch = "arm64ec") => {
#[stable(feature = "simd_aarch64", since = "1.60.0")]
pub use aarch64::*;
pub use aarch64::__is_feature_detected;
pub(crate) use aarch64::Feature;
}
any(target_arch = "riscv32", target_arch = "riscv64") => {
#[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")]
pub use riscv::*;
pub use riscv::__is_feature_detected;
pub(crate) use riscv::Feature;
}
any(target_arch = "powerpc", target_arch = "powerpc64") => {
#[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")]
pub use powerpc::*;
pub use powerpc::__is_feature_detected;
pub(crate) use powerpc::Feature;
}
target_arch = "mips" => {
#[unstable(feature = "stdarch_mips_feature_detection", issue = "111188")]
pub use mips::*;
pub use mips::__is_feature_detected;
pub(crate) use mips::Feature;
}
target_arch = "mips64" => {
#[unstable(feature = "stdarch_mips_feature_detection", issue = "111188")]
pub use mips64::*;
pub use mips64::__is_feature_detected;
pub(crate) use mips64::Feature;
}
any(target_arch = "loongarch32", target_arch = "loongarch64") => {
#[stable(feature = "stdarch_loongarch_feature", since = "1.89.0")]
pub use loongarch::*;
pub use loongarch::__is_feature_detected;
pub(crate) use loongarch::Feature;
}
target_arch = "s390x" => {
#[stable(feature = "stdarch_s390x_feature_detection", since = "1.93.0")]
pub use s390x::*;
pub use s390x::__is_feature_detected;
pub(crate) use s390x::Feature;
}
_ => {
// Unimplemented architecture:
Expand All @@ -64,10 +64,11 @@ cfg_select! {
Null,
}
#[doc(hidden)]
#[unstable(feature = "stdarch_internal", issue = "none")]
pub mod __is_feature_detected {}

impl Feature {
#[doc(hidden)]
pub(crate) const ALL: &[Self] = &[];
#[doc(hidden)]
pub(crate) fn from_str(_s: &str) -> Result<Feature, ()> {
Err(())
Expand Down
Loading
Loading