+
diff --git a/compiler/rustc_borrowck/src/type_check/liveness/trace.rs b/compiler/rustc_borrowck/src/type_check/liveness/trace.rs
index 61aa30aa3917c..90126866cd500 100644
--- a/compiler/rustc_borrowck/src/type_check/liveness/trace.rs
+++ b/compiler/rustc_borrowck/src/type_check/liveness/trace.rs
@@ -6,7 +6,7 @@ use rustc_infer::infer::canonical::QueryRegionConstraints;
use rustc_infer::traits::TraitErrors;
use rustc_middle::mir::{BasicBlock, Body, ConstraintCategory, Local, Location};
use rustc_middle::traits::query::DropckOutlivesResult;
-use rustc_middle::ty::{GenericArg, Ty, TypeVisitable, TypeVisitableExt};
+use rustc_middle::ty::{Ty, TyCtxt, TypeVisitable, TypeVisitableExt};
use rustc_mir_dataflow::impls::MaybeInitializedPlaces;
use rustc_mir_dataflow::move_paths::{HasMoveData, MoveData, MovePathIndex};
use rustc_mir_dataflow::points::{DenseLocationMap, PointIndex};
@@ -553,8 +553,17 @@ impl<'tcx> LivenessContext<'_, '_, 'tcx> {
/// points `live_at`.
fn add_use_live_facts_for(&mut self, value: Ty<'tcx>, live_at: &IntervalSet
) {
debug!("add_use_live_facts_for(value={:?})", value);
- Self::record_region_variance(self.typeck, value.into());
- Self::make_all_regions_live(self.location_map, self.typeck, value.into(), live_at);
+ Self::make_all_regions_live(self.location_map, self.typeck, value, live_at);
+
+ // When using `-Zpolonius=next`, we also record the variance of regions in this live type.
+ if let Some(polonius_context) = self.typeck.polonius_context.as_mut() {
+ record_live_region_variance(
+ self.typeck.infcx.tcx,
+ &mut polonius_context.live_region_variances,
+ self.typeck.universal_regions,
+ value,
+ );
+ }
}
/// Some variable with type `live_ty` is "drop live" at `location`
@@ -595,9 +604,6 @@ impl<'tcx> LivenessContext<'_, '_, 'tcx> {
}
}
- // Since the entire dropped local is live, record the variance of its regions.
- Self::record_region_variance(self.typeck, dropped_ty.into());
-
// All things in the `outlives` array may be touched by
// the destructor and must be live at this point.
for &kind in &drop_data.dropck_result.kinds {
@@ -610,19 +616,16 @@ impl<'tcx> LivenessContext<'_, '_, 'tcx> {
self.typeck.polonius_facts,
);
}
- }
- /// `live_kind` is the type of a (use- or drop-) live local.
- /// Record the variance of any region(s) appearing in it for Polonius. Does
- /// nothing if Polonius is not active.
- fn record_region_variance(typeck: &mut TypeChecker<'_, 'tcx>, live_kind: GenericArg<'tcx>) {
- // When using `-Zpolonius=next`, we record the variance of each live region.
- if let Some(polonius_context) = typeck.polonius_context.as_mut() {
+ // For polonius: since the local is drop live, record the variance of the regions in its
+ // type, not the ones in the type's live components seen in the dropck results above. See
+ // issue #160670.
+ if let Some(polonius_context) = self.typeck.polonius_context.as_mut() {
record_live_region_variance(
- typeck.infcx.tcx,
+ self.typeck.infcx.tcx,
&mut polonius_context.live_region_variances,
- typeck.universal_regions,
- live_kind,
+ self.typeck.universal_regions,
+ dropped_ty,
);
}
}
@@ -630,7 +633,7 @@ impl<'tcx> LivenessContext<'_, '_, 'tcx> {
fn make_all_regions_live(
location_map: &DenseLocationMap,
typeck: &mut TypeChecker<'_, 'tcx>,
- value: GenericArg<'tcx>,
+ value: impl TypeVisitable>,
live_at: &IntervalSet,
) {
debug!("make_all_regions_live(value={:?})", value);
@@ -647,7 +650,6 @@ impl<'tcx> LivenessContext<'_, '_, 'tcx> {
typeck.constraints.liveness_constraints.add_points(live_region_vid, live_at);
},
});
- Self::record_region_variance(typeck, value);
}
}
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
index e0fc60e1a9b7a..735dd0fbaba10 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
@@ -5,7 +5,7 @@ use std::path::PathBuf;
use std::{assert_matches, iter, ptr};
use libc::{c_longlong, c_uint};
-use rustc_abi::{Align, Layout, NumScalableVectors, Size};
+use rustc_abi::{Align, Endian, Layout, NumScalableVectors, Size};
use rustc_codegen_ssa::debuginfo::type_names::{VTableNameKind, cpp_like_debuginfo};
use rustc_codegen_ssa::traits::*;
use rustc_hir::def::{CtorKind, DefKind};
@@ -21,7 +21,7 @@ use rustc_span::{
DUMMY_SP, FileName, RemapPathScopeComponents, SourceFile, Span, Symbol, bug, hygiene,
};
use rustc_symbol_mangling::typeid_for_trait_ref;
-use rustc_target::spec::{Arch, DebuginfoKind};
+use rustc_target::spec::{Arch, DebuginfoKind, HasTargetSpec};
use smallvec::smallvec;
use tracing::{debug, instrument};
@@ -693,33 +693,22 @@ impl MsvcBasicName for ty::UintTy {
}
}
-impl MsvcBasicName for ty::FloatTy {
- fn msvc_basic_name(self) -> &'static str {
- // FIXME(f128): `f128` has no MSVC representation. We could improve the debuginfo.
- // See:
- match self {
- ty::FloatTy::F16 => {
- bug!("`f16` should have been handled in `build_basic_type_di_node`")
- }
- ty::FloatTy::F32 => "float",
- ty::FloatTy::F64 => "double",
- ty::FloatTy::F128 => "fp128",
- }
- }
-}
-
-fn build_cpp_f16_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) -> DINodeCreationResult<'ll> {
- // MSVC has no native support for `f16`. Instead, emit `struct f16 { bits: u16 }` to allow the
- // `f16`'s value to be displayed using a Natvis visualiser in `intrinsic.natvis`.
- let float_ty = cx.tcx.types.f16;
- let bits_ty = cx.tcx.types.u16;
- let def_location = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers {
- match float_ty.kind() {
- ty::Adt(def, _) => Some(file_metadata_from_def_id(cx, Some(def.did()))),
- _ => None,
- }
+/// `float_ty` must be a [`ty::Float`] and `bits_ty` must be a [`ty::Uint`].
+/// `cx.size_of(bits_ty) * bits_names.len()` must equal `cx.size_of(float_ty)`.
+fn build_cpp_float_struct_di_node<'ll, 'tcx>(
+ cx: &CodegenCx<'ll, 'tcx>,
+ float_ty: Ty<'tcx>,
+ bits_ty: Ty<'tcx>,
+ bits_names: &[&str],
+) -> DINodeCreationResult<'ll> {
+ debug_assert!(matches!(bits_ty.kind(), ty::Uint(_)));
+ debug_assert_eq!(cx.size_of(bits_ty) * (bits_names.len() as u64), cx.size_of(float_ty));
+ // MSVC has no native support for `f16` or `f128`. Instead, emit a struct containing the bits as
+ // field(s) to allow the value to be displayed using a Natvis visualiser in `intrinsic.natvis`.
+ let name = if let ty::Float(f) = float_ty.kind() {
+ f.name_str()
} else {
- None
+ bug!("{float_ty:?} was not a float");
};
type_map::build_type_with_children(
cx,
@@ -727,32 +716,33 @@ fn build_cpp_f16_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) -> DINodeCreation
cx,
Stub::Struct,
UniqueTypeId::for_ty(cx.tcx, float_ty),
- "f16",
- def_location,
+ name,
+ None,
cx.size_and_align_of(float_ty),
NO_SCOPE_METADATA,
DIFlags::FlagZero,
),
// Fields:
|cx, float_di_node| {
- let def_id = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers {
- match bits_ty.kind() {
- ty::Adt(def, _) => Some(def.did()),
- _ => None,
- }
- } else {
- None
- };
- smallvec![build_field_di_node(
- cx,
- float_di_node,
- "bits",
- cx.layout_of(bits_ty),
- Size::ZERO,
- DIFlags::FlagZero,
- type_di_node(cx, bits_ty),
- def_id,
- )]
+ let bits_layout = cx.layout_of(bits_ty);
+ let bits_node = type_di_node(cx, bits_ty);
+ bits_names
+ .iter()
+ .copied()
+ .enumerate()
+ .map(|(i, field_name)| {
+ build_field_di_node(
+ cx,
+ float_di_node,
+ field_name,
+ bits_layout,
+ bits_layout.size * (i as u64),
+ DIFlags::FlagZero,
+ bits_node,
+ None,
+ )
+ })
+ .collect()
},
NO_GENERICS,
)
@@ -784,9 +774,20 @@ fn build_basic_type_di_node<'ll, 'tcx>(
ty::Int(int_ty) if cpp_like_debuginfo => (int_ty.msvc_basic_name(), DW_ATE_signed),
ty::Uint(uint_ty) if cpp_like_debuginfo => (uint_ty.msvc_basic_name(), DW_ATE_unsigned),
ty::Float(ty::FloatTy::F16) if cpp_like_debuginfo => {
- return build_cpp_f16_di_node(cx);
+ return build_cpp_float_struct_di_node(cx, t, cx.tcx.types.u16, &["bits"]);
+ }
+ ty::Float(ty::FloatTy::F128) if cpp_like_debuginfo => {
+ // All MSVC architectures are little endian.
+ assert_eq!(cx.target_spec().endian, Endian::Little);
+ return build_cpp_float_struct_di_node(
+ cx,
+ t,
+ cx.tcx.types.u64,
+ &["low_bits", "high_bits"],
+ );
}
- ty::Float(float_ty) if cpp_like_debuginfo => (float_ty.msvc_basic_name(), DW_ATE_float),
+ ty::Float(ty::FloatTy::F32) if cpp_like_debuginfo => ("float", DW_ATE_float),
+ ty::Float(ty::FloatTy::F64) if cpp_like_debuginfo => ("double", DW_ATE_float),
ty::Int(int_ty) => (int_ty.name_str(), DW_ATE_signed),
ty::Uint(uint_ty) => (uint_ty.name_str(), DW_ATE_unsigned),
ty::Float(float_ty) => (float_ty.name_str(), DW_ATE_float),
diff --git a/library/core/src/ffi/c_str.rs b/library/core/src/ffi/c_str.rs
index e5b1f8088a5bf..c851b56c20bc8 100644
--- a/library/core/src/ffi/c_str.rs
+++ b/library/core/src/ffi/c_str.rs
@@ -6,6 +6,7 @@ use crate::ffi::c_char;
use crate::intrinsics::const_eval_select;
use crate::iter::FusedIterator;
use crate::marker::PhantomData;
+use crate::num::niche_types::UsizeNoHighBitMinusOne;
use crate::ptr::NonNull;
use crate::slice::memchr;
use crate::{fmt, ops, range, slice, str};
@@ -262,7 +263,12 @@ impl CStr {
// means the call to `from_bytes_with_nul_unchecked` is correct.
//
// The cast from c_char to u8 is ok because a c_char is always one byte.
- unsafe { Self::from_bytes_with_nul_unchecked(slice::from_raw_parts(ptr.cast(), len + 1)) }
+ unsafe {
+ Self::from_bytes_with_nul_unchecked(slice::from_raw_parts(
+ ptr.cast(),
+ len.as_inner() + 1,
+ ))
+ }
}
/// Creates a C string wrapper from a byte slice with any number of nuls.
@@ -750,9 +756,9 @@ const impl AsRef for CStr {
#[inline]
#[unstable(feature = "cstr_internals", issue = "none")]
#[rustc_allow_const_fn_unstable(const_eval_select)]
-const unsafe fn strlen(ptr: *const c_char) -> usize {
+const unsafe fn strlen(ptr: *const c_char) -> UsizeNoHighBitMinusOne {
const_eval_select!(
- @capture { s: *const c_char = ptr } -> usize:
+ @capture { s: *const c_char = ptr } -> UsizeNoHighBitMinusOne:
if const {
let mut len = 0;
@@ -761,15 +767,16 @@ const unsafe fn strlen(ptr: *const c_char) -> usize {
len += 1;
}
- len
+ UsizeNoHighBitMinusOne::new(len).unwrap()
} else {
unsafe extern "C" {
/// Provided by libc or compiler_builtins.
fn strlen(s: *const c_char) -> usize;
}
- // SAFETY: Outer caller has provided a pointer to a valid C string.
- unsafe { strlen(s) }
+ // SAFETY: Outer caller has provided a pointer to a valid C string,
+ // and its length is within bounds.
+ unsafe { UsizeNoHighBitMinusOne::new_unchecked(strlen(s)) }
}
)
}
@@ -841,7 +848,7 @@ impl Iterator for Bytes<'_> {
#[inline]
fn count(self) -> usize {
// SAFETY: We always hold a valid pointer to a C string
- unsafe { strlen(self.ptr.as_ptr().cast()) }
+ unsafe { strlen(self.ptr.as_ptr().cast()) }.as_inner()
}
}
diff --git a/library/core/src/num/niche_types.rs b/library/core/src/num/niche_types.rs
index df1cdf0e65fa1..37037d8145fb0 100644
--- a/library/core/src/num/niche_types.rs
+++ b/library/core/src/num/niche_types.rs
@@ -111,6 +111,7 @@ const impl Default for Nanoseconds {
}
const HALF_USIZE: usize = usize::MAX >> 1;
+const HALF_USIZE_MINUS_ONE: usize = HALF_USIZE - 1;
define_valid_range_type! {
pub struct NonZeroU8Inner(u8 is 1..);
@@ -126,6 +127,7 @@ define_valid_range_type! {
pub struct NonZeroI128Inner(i128 is ..0 | 1..);
pub struct UsizeNoHighBit(usize is 0..=HALF_USIZE);
+ pub struct UsizeNoHighBitMinusOne(usize is 0..=HALF_USIZE_MINUS_ONE);
pub struct NonZeroUsizeInner(usize is 1..);
pub struct NonZeroIsizeInner(isize is ..0 | 1..);
diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs
index 5d8dee0b9378a..0563c225f7e0b 100644
--- a/library/core/src/num/nonzero.rs
+++ b/library/core/src/num/nonzero.rs
@@ -1414,6 +1414,40 @@ macro_rules! nonzero_integer {
#[stable(feature = "nonzero_parse", since = "1.35.0")]
impl FromStr for NonZero<$Int> {
type Err = ParseIntError;
+
+ /// Parses a non-zero integer from a string slice with decimal digits.
+ ///
+ /// The characters are expected to be an optional
+ #[doc = sign_dependent_expr!{
+ $signedness ?
+ if signed {
+ " `+` or `-` "
+ }
+ if unsigned {
+ " `+` "
+ }
+ }]
+ /// sign followed by only digits. Leading and trailing non-digit characters (including
+ /// whitespace) represent an error. Underscores (which are accepted in Rust literals)
+ /// also represent an error.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use std::num::NonZero;
+ /// use std::str::FromStr;
+ ///
+ #[doc = concat!("assert_eq!(NonZero::<", stringify!($Int), ">::from_str(\"+10\"), Ok(NonZero::new(10).unwrap()));")]
+ /// ```
+ ///
+ /// Trailing space returns error:
+ ///
+ /// ```
+ /// use std::num::NonZero;
+ /// use std::str::FromStr;
+ ///
+ #[doc = concat!("assert!(NonZero::<", stringify!($Int), ">::from_str(\"1 \").is_err());")]
+ /// ```
fn from_str(src: &str) -> Result {
Self::from_str_radix(src, 10)
}
diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs
index db52d3bada4c8..cc96e51d83393 100644
--- a/library/core/src/str/mod.rs
+++ b/library/core/src/str/mod.rs
@@ -2912,7 +2912,7 @@ impl str {
/// Converts this string to its ASCII upper case equivalent in-place.
///
/// ASCII letters 'a' to 'z' are mapped to 'A' to 'Z',
- /// but non-ASCII letters are unchanged.
+ /// but all other characters are unchanged.
///
/// To return a new uppercased value without modifying the existing one, use
/// [`to_ascii_uppercase()`].
@@ -2940,7 +2940,7 @@ impl str {
/// Converts this string to its ASCII lower case equivalent in-place.
///
/// ASCII letters 'A' to 'Z' are mapped to 'a' to 'z',
- /// but non-ASCII letters are unchanged.
+ /// but all other characters are unchanged.
///
/// To return a new lowercased value without modifying the existing one, use
/// [`to_ascii_lowercase()`].
diff --git a/src/etc/lldb_lookup.py b/src/etc/lldb_lookup.py
index 365816dc8489a..94ed47af1891f 100644
--- a/src/etc/lldb_lookup.py
+++ b/src/etc/lldb_lookup.py
@@ -40,6 +40,7 @@
ClangEncodedEnumSummaryProvider,
StructSummaryProvider,
f16SummaryProvider,
+ f128SummaryProvider,
# re-exports
get_template_args as get_template_args,
resolve_msvc_template_arg as resolve_msvc_template_arg,
@@ -181,6 +182,17 @@ def register_providers_compatibility():
DEFAULT_TYPE_OPTIONS | lldb.eTypeOptionHideChildren,
)
+ if LLDBFeature.Float128 in FEATURE_FLAGS:
+ # Force f128 summary on windows-msvc since most Windows debuggers don't support PDB f128
+ register_summary(
+ f128SummaryProvider,
+ lldb.SBTypeNameSpecifier(
+ MOD_PREFIX + is_msvc_f128.__name__,
+ lldb.eFormatterMatchCallback,
+ ),
+ DEFAULT_TYPE_OPTIONS | lldb.eTypeOptionHideChildren,
+ )
+
# Tuple-structs
register_synth(
TupleSyntheticProvider,
@@ -501,6 +513,11 @@ def is_msvc_f16(type: lldb.SBType, _dict: LLDBOpaque) -> bool:
return type.GetName() == "f16" and type.IsAggregateType()
+def is_msvc_f128(type: lldb.SBType, _dict: LLDBOpaque) -> bool:
+ # Most Windows debuggers don't support PDB f128.
+ return type.GetName() == "f128" and type.IsAggregateType()
+
+
def classify_rust_type(type: lldb.SBType, is_msvc: bool) -> RustType:
if type.IsPointerType():
return RustType.Indirection
diff --git a/src/etc/lldb_providers.py b/src/etc/lldb_providers.py
index 2791dae3600b0..a3a424ac1abce 100644
--- a/src/etc/lldb_providers.py
+++ b/src/etc/lldb_providers.py
@@ -542,6 +542,12 @@ def f16SummaryProvider(valobj: SBValue, _dict: LLDBOpaque) -> str:
)
+def f128SummaryProvider(valobj: SBValue, _dict: LLDBOpaque) -> str:
+ from lldb import eBasicTypeFloat128
+
+ return valobj.Cast(valobj.GetTarget().GetBasicType(eBasicTypeFloat128)).GetValue()
+
+
def sequence_formatter(output: str, valobj: SBValue, _dict: LLDBOpaque):
length: int = valobj.GetNumChildren()
diff --git a/src/etc/natvis/intrinsic.natvis b/src/etc/natvis/intrinsic.natvis
index 49e0ce319efac..ac9bf1c427957 100644
--- a/src/etc/natvis/intrinsic.natvis
+++ b/src/etc/natvis/intrinsic.natvis
@@ -59,6 +59,118 @@
{(float) (sign() * (raw_significand() + 1.0) * two_pow_exponent())}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {sign()}inf
+ NaN
+
+ {sign()}0x0p+0
+
+ {sign()}0x1{subnormal_hex()}p{-16382 - subnormal_shift(),d}
+ {sign()}0x1{normal_hex()}p{normal_exponent_sign()}{normal_exponent(),d}
+
+
+ - "0x" + hex128(high_bits, low_bits, 128)
+
+
()
diff --git a/tests/codegen-llvm/cstr-len-plus-one.rs b/tests/codegen-llvm/cstr-len-plus-one.rs
new file mode 100644
index 0000000000000..056f59070df09
--- /dev/null
+++ b/tests/codegen-llvm/cstr-len-plus-one.rs
@@ -0,0 +1,15 @@
+//@ compile-flags: -Copt-level=3 -Cpanic=abort
+
+#![crate_type = "lib"]
+#![feature(cstr_bytes)]
+
+use std::ffi::CStr;
+
+// A `CStr`'s length always fits in an isize after the NUL bit is accounted for
+
+// CHECK-LABEL: @cstr_len_plus_one
+#[no_mangle]
+pub fn cstr_len_plus_one(s: &CStr) -> bool {
+ // CHECK: ret i1 true
+ s.bytes().count() + 1 <= isize::MAX as usize
+}
diff --git a/tests/debuginfo/basic-types-globals-metadata.rs b/tests/debuginfo/basic-types-globals-metadata.rs
index 3f1d9fd5de278..306c8978a508e 100644
--- a/tests/debuginfo/basic-types-globals-metadata.rs
+++ b/tests/debuginfo/basic-types-globals-metadata.rs
@@ -33,11 +33,13 @@
//@ gdb-check:type = f32
//@ gdb-command:whatis basic_types_globals_metadata::F64
//@ gdb-check:type = f64
+//@ gdb-command:whatis basic_types_globals_metadata::F128
+//@ gdb-check:type = f128
//@ gdb-command:continue
#![allow(unused_variables)]
#![allow(dead_code)]
-#![feature(f16)]
+#![feature(f16, f128)]
// N.B. These are `mut` only so they don't constant fold away.
static mut B: bool = false;
@@ -55,13 +57,14 @@ static mut U64: u64 = 64;
static mut F16: f16 = 1.5;
static mut F32: f32 = 2.5;
static mut F64: f64 = 3.5;
+static mut F128: f128 = 4.5;
fn main() {
_zzz(); // #break
- let a = unsafe { (B, I, C, I8, I16, I32, I64, U, U8, U16, U32, U64, F32, F64) };
- // FIXME: Including f16 and f32 in the same tuple emits `__gnu_h2f_ieee`, which
- // does not exist on some targets like PowerPC.
+ let a = unsafe { (B, I, C, I8, I16, I32, I64, U, U8, U16, U32, U64, F32, F64, F128) };
+ // FIXME(f16): Including f16 and f32 in the same tuple emits `__gnu_h2f_ieee`, which
+ // does not exist on some targets like PowerPC (fixed in llvm22).
// See https://github.com/llvm/llvm-project/issues/97981 and
// https://github.com/rust-lang/compiler-builtins/issues/655
let b = unsafe { F16 };
diff --git a/tests/debuginfo/basic-types-globals.rs b/tests/debuginfo/basic-types-globals.rs
index 044b757aaf470..3bc9d3becdade 100644
--- a/tests/debuginfo/basic-types-globals.rs
+++ b/tests/debuginfo/basic-types-globals.rs
@@ -1,11 +1,20 @@
-//@ revisions: lto no-lto
+//@ revisions: lto no-lto lto-apple no-lto-apple
//@ compile-flags:-g --crate-name=basic_types_globals
//@ disable-gdb-pretty-printers
+// FIXME(f128): Merge `-apple` revisions once Apple releases Xcode with LLVM 22.
+//@ [lto] ignore-apple
+//@ [no-lto] ignore-apple
+//@ [lto-apple] only-apple
+//@ [no-lto-apple] only-apple
//@ [lto] compile-flags:-C lto
//@ [lto] no-prefer-dynamic
+//@ [lto-apple] compile-flags:-C lto
+//@ [lto-apple] no-prefer-dynamic
//@ ignore-backends: gcc
+// `f128` support was added to `lldb` in version 22.
+//@ min-llvm-lldb-version: 22
//@ lldb-command:run
//@ lldb-command:v basic_types_globals::B
@@ -38,6 +47,9 @@
//@ lldb-check:[...]basic_types_globals::F32 = 2.5
//@ lldb-command:v basic_types_globals::F64
//@ lldb-check:[...]basic_types_globals::F64 = 3.5
+//@ lldb-command:v basic_types_globals::F128
+//@[no-lto] lldb-check:[...]basic_types_globals::F128 = 4.5
+//@[lto] lldb-check:[...]basic_types_globals::F128 = 4.5
//@ gdb-command:run
//@ gdb-command:print B
@@ -70,10 +82,11 @@
//@ gdb-check:$14 = 2.5
//@ gdb-command:print F64
//@ gdb-check:$15 = 3.5
+// FIXME(f128): gdb doesn't support Rust `f128` yet.
//@ gdb-command:continue
#![allow(unused_variables)]
-#![feature(f16)]
+#![feature(f16, f128)]
// N.B. These are `mut` only so they don't constant fold away.
static mut B: bool = false;
@@ -91,13 +104,14 @@ static mut U64: u64 = 64;
static mut F16: f16 = 1.5;
static mut F32: f32 = 2.5;
static mut F64: f64 = 3.5;
+static mut F128: f128 = 4.5;
fn main() {
_zzz(); // #break
- let a = unsafe { (B, I, C, I8, I16, I32, I64, U, U8, U16, U32, U64, F32, F64) };
- // FIXME: Including f16 and f32 in the same tuple emits `__gnu_h2f_ieee`, which
- // does not exist on some targets like PowerPC.
+ let a = unsafe { (B, I, C, I8, I16, I32, I64, U, U8, U16, U32, U64, F32, F64, F128) };
+ // FIXME(f16): Including f16 and f32 in the same tuple emits `__gnu_h2f_ieee`, which
+ // does not exist on some targets like PowerPC (fixed in llvm22).
// See https://github.com/llvm/llvm-project/issues/97981 and
// https://github.com/rust-lang/compiler-builtins/issues/655
let b = unsafe { F16 };
diff --git a/tests/debuginfo/basic-types-metadata.rs b/tests/debuginfo/basic-types-metadata.rs
index d3a3d03ef7424..39fa9150214b5 100644
--- a/tests/debuginfo/basic-types-metadata.rs
+++ b/tests/debuginfo/basic-types-metadata.rs
@@ -35,6 +35,8 @@
//@ gdb-check:type = f32
//@ gdb-command:whatis f64
//@ gdb-check:type = f64
+//@ gdb-command:whatis f128
+//@ gdb-check:type = f128
//@ gdb-command:whatis fnptr
//@ gdb-check:type = *mut fn ()
//@ gdb-command:info functions _yyy
@@ -54,7 +56,7 @@
//@ gdb-command:continue
#![allow(unused_variables)]
-#![feature(f16)]
+#![feature(f16, f128)]
fn main() {
let unit: () = ();
@@ -73,6 +75,7 @@ fn main() {
let f16: f16 = 1.5;
let f32: f32 = 2.5;
let f64: f64 = 3.5;
+ let f128: f128 = 4.5;
let fnptr : fn() = _zzz;
let closure_0 = || {};
let closure_1 = || { b; };
diff --git a/tests/debuginfo/basic-types-mut-globals.rs b/tests/debuginfo/basic-types-mut-globals.rs
index c3cc7be549d47..3f59da2a5d2e0 100644
--- a/tests/debuginfo/basic-types-mut-globals.rs
+++ b/tests/debuginfo/basic-types-mut-globals.rs
@@ -1,13 +1,14 @@
-// Caveats - gdb prints any 8-bit value (meaning rust I8 and u8 values)
-// as its numerical value along with its associated ASCII char, there
-// doesn't seem to be any way around this. Also, gdb doesn't know
-// about UTF-32 character encoding and will print a rust char as only
-// its numerical value.
-
-//@ compile-flags:-g
+//@ compile-flags:-g --crate-name=basic_types_mut_globals
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
+// FIXME(f128): Merge `apple` revision once Apple releases Xcode with LLVM 22.
+//@ revisions: not-apple apple
+//@[not-apple] ignore-apple
+//@[apple] only-apple
+// `f128` support was added to `lldb` in version 22.
+//@ min-llvm-lldb-version: 22
+
//@ gdb-command:run
// Check initializers
@@ -41,6 +42,7 @@
//@ gdb-check:$14 = 2.5
//@ gdb-command:print F64
//@ gdb-check:$15 = 3.5
+// FIXME(f128): gdb doesn't support Rust `f128` yet.
//@ gdb-command:continue
// Check new values
@@ -50,7 +52,7 @@
//@ gdb-check:$17 = 2
//@ gdb-command:print C
//@ gdb-check:$18 = 102 'f'
-//@ gdb-command:print/d I8
+//@ gdb-command:print I8
//@ gdb-check:$19 = 78
//@ gdb-command:print I16
//@ gdb-check:$20 = -26
@@ -60,7 +62,7 @@
//@ gdb-check:$22 = -54
//@ gdb-command:print U
//@ gdb-check:$23 = 5
-//@ gdb-command:print/d U8
+//@ gdb-command:print U8
//@ gdb-check:$24 = 20
//@ gdb-command:print U16
//@ gdb-check:$25 = 32
@@ -74,9 +76,81 @@
//@ gdb-check:$29 = 5.75
//@ gdb-command:print F64
//@ gdb-check:$30 = 9.25
+// FIXME(f128): gdb doesn't support Rust `f128` yet.
+
+//@ lldb-command:run
+
+// Check initializers
+//@ lldb-command:v basic_types_mut_globals::B
+//@ lldb-check:[...]basic_types_mut_globals::B = false
+//@ lldb-command:v basic_types_mut_globals::I
+//@ lldb-check:[...]basic_types_mut_globals::I = -1
+//@ lldb-command:v basic_types_mut_globals::C
+//@ lldb-check:[...]basic_types_mut_globals::C = U+0x00000061 U'a'
+//@ lldb-command:v/d basic_types_mut_globals::I8
+//@ lldb-check:[...]basic_types_mut_globals::I8 = 68
+//@ lldb-command:v basic_types_mut_globals::I16
+//@ lldb-check:[...]basic_types_mut_globals::I16 = -16
+//@ lldb-command:v basic_types_mut_globals::I32
+//@ lldb-check:[...]basic_types_mut_globals::I32 = -32
+//@ lldb-command:v basic_types_mut_globals::I64
+//@ lldb-check:[...]basic_types_mut_globals::I64 = -64
+//@ lldb-command:v basic_types_mut_globals::U
+//@ lldb-check:[...]basic_types_mut_globals::U = 1
+//@ lldb-command:v/d basic_types_mut_globals::U8
+//@ lldb-check:[...]basic_types_mut_globals::U8 = 100
+//@ lldb-command:v basic_types_mut_globals::U16
+//@ lldb-check:[...]basic_types_mut_globals::U16 = 16
+//@ lldb-command:v basic_types_mut_globals::U32
+//@ lldb-check:[...]basic_types_mut_globals::U32 = 32
+//@ lldb-command:v basic_types_mut_globals::U64
+//@ lldb-check:[...]basic_types_mut_globals::U64 = 64
+//@ lldb-command:v basic_types_mut_globals::F16
+//@ lldb-check:[...]basic_types_mut_globals::F16 = 1.5
+//@ lldb-command:v basic_types_mut_globals::F32
+//@ lldb-check:[...]basic_types_mut_globals::F32 = 2.5
+//@ lldb-command:v basic_types_mut_globals::F64
+//@ lldb-check:[...]basic_types_mut_globals::F64 = 3.5
+//@ lldb-command:v basic_types_mut_globals::F128
+//@[not-apple] lldb-check:[...]basic_types_mut_globals::F128 = 4.5
+//@ lldb-command:continue
+
+// Check new values
+//@ lldb-command:v basic_types_mut_globals::B
+//@ lldb-check:[...]basic_types_mut_globals::B = true
+//@ lldb-command:v basic_types_mut_globals::I
+//@ lldb-check:[...]basic_types_mut_globals::I = 2
+//@ lldb-command:v basic_types_mut_globals::C
+//@ lldb-check:[...]basic_types_mut_globals::C = U+0x00000066 U'f'
+//@ lldb-command:v/d basic_types_mut_globals::I8
+//@ lldb-check:[...]basic_types_mut_globals::I8 = 78
+//@ lldb-command:v basic_types_mut_globals::I16
+//@ lldb-check:[...]basic_types_mut_globals::I16 = -26
+//@ lldb-command:v basic_types_mut_globals::I32
+//@ lldb-check:[...]basic_types_mut_globals::I32 = -12
+//@ lldb-command:v basic_types_mut_globals::I64
+//@ lldb-check:[...]basic_types_mut_globals::I64 = -54
+//@ lldb-command:v basic_types_mut_globals::U
+//@ lldb-check:[...]basic_types_mut_globals::U = 5
+//@ lldb-command:v/d basic_types_mut_globals::U8
+//@ lldb-check:[...]basic_types_mut_globals::U8 = 20
+//@ lldb-command:v basic_types_mut_globals::U16
+//@ lldb-check:[...]basic_types_mut_globals::U16 = 32
+//@ lldb-command:v basic_types_mut_globals::U32
+//@ lldb-check:[...]basic_types_mut_globals::U32 = 16
+//@ lldb-command:v basic_types_mut_globals::U64
+//@ lldb-check:[...]basic_types_mut_globals::U64 = 128
+//@ lldb-command:v basic_types_mut_globals::F16
+//@ lldb-check:[...]basic_types_mut_globals::F16 = 2.25
+//@ lldb-command:v basic_types_mut_globals::F32
+//@ lldb-check:[...]basic_types_mut_globals::F32 = 5.75
+//@ lldb-command:v basic_types_mut_globals::F64
+//@ lldb-check:[...]basic_types_mut_globals::F64 = 9.25
+//@ lldb-command:v basic_types_mut_globals::F128
+//@[not-apple] lldb-check:[...]basic_types_mut_globals::F128 = 12.75
#![allow(unused_variables)]
-#![feature(f16)]
+#![feature(f16, f128)]
static mut B: bool = false;
static mut I: isize = -1;
@@ -93,6 +167,7 @@ static mut U64: u64 = 64;
static mut F16: f16 = 1.5;
static mut F32: f32 = 2.5;
static mut F64: f64 = 3.5;
+static mut F128: f128 = 4.5;
fn main() {
_zzz(); // #break
@@ -113,6 +188,7 @@ fn main() {
F16 = 2.25;
F32 = 5.75;
F64 = 9.25;
+ F128 = 12.75;
}
_zzz(); // #break
diff --git a/tests/debuginfo/basic-types/main.rs b/tests/debuginfo/basic-types/main.rs
index 9f61862c0dfd8..d01e51036f201 100644
--- a/tests/debuginfo/basic-types/main.rs
+++ b/tests/debuginfo/basic-types/main.rs
@@ -1,9 +1,3 @@
-// Caveats - gdb prints any 8-bit value (meaning rust i8 and u8 values)
-// as its numerical value along with its associated ASCII char, there
-// doesn't seem to be any way around this. Also, gdb doesn't know
-// about UTF-32 character encoding and will print a rust char as only
-// its numerical value.
-
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
@@ -32,6 +26,7 @@
//@ gdb-repr:f16
//@ gdb-repr:f32
//@ gdb-repr:f64
+// FIXME(f128): gdb doesn't support Rust `f128` yet.
//@ gdb-repr:s
// === LLDB TESTS ==================================================================================
@@ -85,13 +80,16 @@
//@ cdb-check:f32 : 2.500000 [Type: float]
//@ cdb-command:dx f64
//@ cdb-check:f64 : 3.500000 [Type: double]
+//@ cdb-command:dx f128
+//@ cdb-check:f128 : 0x1.2p+2 [Type: f128]
+//@ cdb-check:bits : 0x40012000000000000000000000000000
//@ cdb-command:.enable_unicode 1
// FIXME(#88840): The latest version of the Windows SDK broke the visualizer for str.
//@ cdb-command:dx s
//@ cdb-check:s : [...] [Type: ref$]
#![allow(unused_variables)]
-#![feature(f16)]
+#![feature(f16, f128)]
fn main() {
let b: bool = false;
@@ -109,6 +107,7 @@ fn main() {
let f16: f16 = 1.5;
let f32: f32 = 2.5;
let f64: f64 = 3.5;
+ let f128: f128 = 4.5;
let s: &str = "Hello, World!";
_zzz(); // #break
}
diff --git a/tests/debuginfo/borrowed-basic.rs b/tests/debuginfo/borrowed-basic.rs
index f7b7d2cbd810c..2872bc65fac3f 100644
--- a/tests/debuginfo/borrowed-basic.rs
+++ b/tests/debuginfo/borrowed-basic.rs
@@ -2,6 +2,13 @@
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
+// FIXME(f128): Merge `apple` revision once Apple releases Xcode with LLVM 22.
+//@ revisions: not-apple apple
+//@[not-apple] ignore-apple
+//@[apple] only-apple
+// `f128` support was added to `lldb` in version 22.
+//@ min-llvm-lldb-version: 22
+
// === GDB TESTS ===================================================================================
//@ gdb-command:run
@@ -50,6 +57,8 @@
//@ gdb-command:print *f64_ref
//@ gdb-check:$15 = 3.5
+// FIXME(f128): gdb doesn't support Rust `f128` yet.
+
// === LLDB TESTS ==================================================================================
@@ -99,8 +108,11 @@
//@ lldb-command:v *f64_ref
//@ lldb-check:[...] 3.5
+//@ lldb-command:v *f128_ref
+//@[not-apple] lldb-check:[...] 4.5
+
#![allow(unused_variables)]
-#![feature(f16)]
+#![feature(f16, f128)]
fn main() {
let bool_val: bool = true;
@@ -148,6 +160,9 @@ fn main() {
let f64_val: f64 = 3.5;
let f64_ref: &f64 = &f64_val;
+ let f128_val: f128 = 4.5;
+ let f128_ref: &f128 = &f128_val;
+
zzz(); // #break
}
diff --git a/tests/debuginfo/borrowed-unique-basic.rs b/tests/debuginfo/borrowed-unique-basic.rs
index 17939239c0dea..0d1fdec0f58d1 100644
--- a/tests/debuginfo/borrowed-unique-basic.rs
+++ b/tests/debuginfo/borrowed-unique-basic.rs
@@ -2,6 +2,13 @@
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
+// FIXME(f128): Merge `apple` revision once Apple releases Xcode with LLVM 22.
+//@ revisions: not-apple apple
+//@[not-apple] ignore-apple
+//@[apple] only-apple
+// `f128` support was added to `lldb` in version 22.
+//@ min-llvm-lldb-version: 22
+
// === GDB TESTS ===================================================================================
//@ gdb-command:run
@@ -51,6 +58,8 @@
//@ gdb-command:print *f64_ref
//@ gdb-check:$15 = 3.5
+// FIXME(f128): gdb doesn't support Rust `f128` yet.
+
// === LLDB TESTS ==================================================================================
@@ -102,8 +111,11 @@
//@ lldb-command:v *f64_ref
//@ lldb-check:[...] 3.5
+//@ lldb-command:v *f128_ref
+//@[not-apple] lldb-check:[...] 4.5
+
#![allow(unused_variables)]
-#![feature(f16)]
+#![feature(f16, f128)]
fn main() {
let bool_box: Box = Box::new(true);
@@ -151,6 +163,9 @@ fn main() {
let f64_box: Box = Box::new(3.5);
let f64_ref: &f64 = &*f64_box;
+ let f128_box: Box = Box::new(4.5);
+ let f128_ref: &f128 = &*f128_box;
+
zzz(); // #break
}
diff --git a/tests/debuginfo/f128-natvis.rs b/tests/debuginfo/f128-natvis.rs
new file mode 100644
index 0000000000000..5f91014cfe5db
--- /dev/null
+++ b/tests/debuginfo/f128-natvis.rs
@@ -0,0 +1,92 @@
+//@ compile-flags: -g
+//@ only-msvc
+
+// This tests the `f128` Natvis visualiser.
+//@ cdb-command:g
+//@ cdb-command:dx v0_0
+//@ cdb-check:v0_0 : 0x0p+0 [Type: f128]
+//@ cdb-check:bits : 0x00000000000000000000000000000000
+//@ cdb-command:dx neg_0_0
+//@ cdb-check:neg_0_0 : -0x0p+0 [Type: f128]
+//@ cdb-check:bits : 0x80000000000000000000000000000000
+//@ cdb-command:dx v1_0
+//@ cdb-check:v1_0 : 0x1p+0 [Type: f128]
+//@ cdb-check:bits : 0x3fff0000000000000000000000000000
+//@ cdb-command:dx v1_5
+//@ cdb-check:v1_5 : 0x1.8p+0 [Type: f128]
+//@ cdb-check:bits : 0x3fff8000000000000000000000000000
+//@ cdb-command:dx v72_3
+//@ cdb-check:v72_3 : 0x1.2133333333333333333333333333p+6 [Type: f128]
+//@ cdb-check:bits : 0x40052133333333333333333333333333
+//@ cdb-command:dx neg_0_126
+//@ cdb-check:neg_0_126 : -0x1.020c49ba5e353f7ced916872b021p-3 [Type: f128]
+//@ cdb-check:bits : 0xbffc020c49ba5e353f7ced916872b021
+//@ cdb-command:dx v0_00003
+//@ cdb-check:v0_00003 : 0x1.f75104d551d68c692f6e82949a56p-16 [Type: f128]
+//@ cdb-check:bits : 0x3feff75104d551d68c692f6e82949a56
+//@ cdb-command:dx neg_0_00004
+//@ cdb-check:neg_0_00004 : -0x1.4f8b588e368f08461f9f01b866e4p-15 [Type: f128]
+//@ cdb-check:bits : 0xbff04f8b588e368f08461f9f01b866e4
+//@ cdb-command:dx very_small
+//@ cdb-check:very_small : 0x1p-16494 [Type: f128]
+//@ cdb-check:bits : 0x00000000000000000000000000000001
+//@ cdb-command:dx not_quite_as_small
+//@ cdb-check:not_quite_as_small : 0x1.8p-16385 [Type: f128]
+//@ cdb-check:bits : 0x00003000000000000000000000000000
+//@ cdb-command:dx smallest_pos_normal
+//@ cdb-check:smallest_pos_normal : 0x1p-16382 [Type: f128]
+//@ cdb-check:bits : 0x00010000000000000000000000000000
+//@ cdb-command:dx smallest_subnormal
+//@ cdb-check:smallest_subnormal : -0x1.fffffffffffffffffffffffffffep-16383 [Type: f128]
+//@ cdb-check:bits : 0x8000ffffffffffffffffffffffffffff
+//@ cdb-command:dx just_above
+//@ cdb-check:just_above : -0x1.ffffffffffffffffffffffffff8p-1 [Type: f128]
+//@ cdb-check:bits : 0xbffeffffffffffffffffffffffffff80
+//@ cdb-command:dx max
+//@ cdb-check:max : 0x1.ffffffffffffffffffffffffffffp+16383 [Type: f128]
+//@ cdb-check:bits : 0x7ffeffffffffffffffffffffffffffff
+//@ cdb-command:dx min
+//@ cdb-check:min : -0x1.ffffffffffffffffffffffffffffp+16383 [Type: f128]
+//@ cdb-check:bits : 0xfffeffffffffffffffffffffffffffff
+//@ cdb-command:dx inf
+//@ cdb-check:inf : inf [Type: f128]
+//@ cdb-check:bits : 0x7fff0000000000000000000000000000
+//@ cdb-command:dx neg_inf
+//@ cdb-check:neg_inf : -inf [Type: f128]
+//@ cdb-check:bits : 0xffff0000000000000000000000000000
+//@ cdb-command:dx nan
+//@ cdb-check:nan : NaN [Type: f128]
+//@ cdb-check:bits : 0x7fff8000000000000000000000000000
+//@ cdb-command:dx other_nan
+//@ cdb-check:other_nan : NaN [Type: f128]
+//@ cdb-check:bits : 0xffff123456789abcdef123456789abcd
+
+#![feature(f128)]
+
+fn main() {
+ let v0_0 = 0.0_f128;
+ let neg_0_0 = -0.0_f128;
+ let v1_0 = 1.0_f128;
+ let v1_5 = 1.5_f128;
+ let v72_3 = 72.3_f128;
+ let neg_0_126 = -0.126_f128;
+ let v0_00003 = 0.00003_f128;
+ let neg_0_00004 = -0.00004_f128;
+ let very_small = 0.0_f128.next_up();
+ let not_quite_as_small = const { f128::MIN_POSITIVE / 8.0 + f128::MIN_POSITIVE / 16.0 };
+ let smallest_pos_normal = f128::MIN_POSITIVE;
+ let smallest_subnormal = (-f128::MIN_POSITIVE).next_up();
+ let just_above = const { -1.0 + f128::EPSILON * 64.0 };
+ let max = f128::MAX;
+ let min = f128::MIN;
+ let inf = f128::INFINITY;
+ let neg_inf = f128::NEG_INFINITY;
+ let nan = f128::NAN;
+ let other_nan = f128::from_bits(0xffff_1234_5678_9abc_def1_2345_6789_abcd);
+
+ _zzz(); // #break
+}
+
+fn _zzz() {
+ ()
+}
diff --git a/tests/debuginfo/reference-debuginfo.rs b/tests/debuginfo/reference-debuginfo.rs
index 518e1dac2885e..495dde379da7e 100644
--- a/tests/debuginfo/reference-debuginfo.rs
+++ b/tests/debuginfo/reference-debuginfo.rs
@@ -2,10 +2,18 @@
// That pass replaces debuginfo for `a => _x` where `_x = &b` to be `a => &b`,
// and leaves codegen to create a ladder of allocations so as `*a == b`.
//
+// FIXME: Currently emits warning: MIR pass `ConstDebugInfo` is unknown and will be ignored
//@ compile-flags:-g -Zmir-enable-passes=+ReferencePropagation,-ConstDebugInfo
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
+// FIXME(f128): Merge `apple` revision once Apple releases Xcode with LLVM 22.
+//@ revisions: not-apple apple
+//@[not-apple] ignore-apple
+//@[apple] only-apple
+// `f128` support was added to `lldb` in version 22.
+//@ min-llvm-lldb-version: 22
+
// === GDB TESTS ===================================================================================
//@ gdb-command:run
@@ -54,6 +62,8 @@
//@ gdb-command:print *f64_ref
//@ gdb-check:$15 = 3.5
+// FIXME(f128): gdb doesn't support Rust `f128` yet.
+
//@ gdb-command:print *f64_double_ref
//@ gdb-check:$16 = 3.5
@@ -106,11 +116,14 @@
//@ lldb-command:v *f64_ref
//@ lldb-check:[...] 3.5
+//@ lldb-command:v *f128_ref
+//@[not-apple] lldb-check:[...] 4.5
+
//@ lldb-command:v *f64_double_ref
//@ lldb-check:[...] 3.5
#![allow(unused_variables)]
-#![feature(f16)]
+#![feature(f16, f128)]
fn main() {
let bool_val: bool = true;
@@ -159,6 +172,9 @@ fn main() {
let f64_ref: &f64 = &f64_val;
let f64_double_ref: &f64 = &f64_ref;
+ let f128_val: f128 = 4.5;
+ let f128_ref: &f128 = &f128_val;
+
zzz(); // #break
}
diff --git a/tests/rustdoc-html/slice-links.link_box_generic.html b/tests/rustdoc-html/codeblock/slice-links.link_box_generic.html
similarity index 100%
rename from tests/rustdoc-html/slice-links.link_box_generic.html
rename to tests/rustdoc-html/codeblock/slice-links.link_box_generic.html
diff --git a/tests/rustdoc-html/slice-links.link_box_u32.html b/tests/rustdoc-html/codeblock/slice-links.link_box_u32.html
similarity index 100%
rename from tests/rustdoc-html/slice-links.link_box_u32.html
rename to tests/rustdoc-html/codeblock/slice-links.link_box_u32.html
diff --git a/tests/rustdoc-html/slice-links.link_slice_generic.html b/tests/rustdoc-html/codeblock/slice-links.link_slice_generic.html
similarity index 100%
rename from tests/rustdoc-html/slice-links.link_slice_generic.html
rename to tests/rustdoc-html/codeblock/slice-links.link_slice_generic.html
diff --git a/tests/rustdoc-html/slice-links.link_slice_u32.html b/tests/rustdoc-html/codeblock/slice-links.link_slice_u32.html
similarity index 100%
rename from tests/rustdoc-html/slice-links.link_slice_u32.html
rename to tests/rustdoc-html/codeblock/slice-links.link_slice_u32.html
diff --git a/tests/rustdoc-html/slice-links.rs b/tests/rustdoc-html/codeblock/slice-links.rs
similarity index 100%
rename from tests/rustdoc-html/slice-links.rs
rename to tests/rustdoc-html/codeblock/slice-links.rs
diff --git a/tests/rustdoc-html/tuples.link1_i32.html b/tests/rustdoc-html/codeblock/tuples.link1_i32.html
similarity index 100%
rename from tests/rustdoc-html/tuples.link1_i32.html
rename to tests/rustdoc-html/codeblock/tuples.link1_i32.html
diff --git a/tests/rustdoc-html/tuples.link1_t.html b/tests/rustdoc-html/codeblock/tuples.link1_t.html
similarity index 100%
rename from tests/rustdoc-html/tuples.link1_t.html
rename to tests/rustdoc-html/codeblock/tuples.link1_t.html
diff --git a/tests/rustdoc-html/tuples.link2_i32.html b/tests/rustdoc-html/codeblock/tuples.link2_i32.html
similarity index 100%
rename from tests/rustdoc-html/tuples.link2_i32.html
rename to tests/rustdoc-html/codeblock/tuples.link2_i32.html
diff --git a/tests/rustdoc-html/tuples.link2_t.html b/tests/rustdoc-html/codeblock/tuples.link2_t.html
similarity index 100%
rename from tests/rustdoc-html/tuples.link2_t.html
rename to tests/rustdoc-html/codeblock/tuples.link2_t.html
diff --git a/tests/rustdoc-html/tuples.link2_tu.html b/tests/rustdoc-html/codeblock/tuples.link2_tu.html
similarity index 100%
rename from tests/rustdoc-html/tuples.link2_tu.html
rename to tests/rustdoc-html/codeblock/tuples.link2_tu.html
diff --git a/tests/rustdoc-html/tuples.link_unit.html b/tests/rustdoc-html/codeblock/tuples.link_unit.html
similarity index 100%
rename from tests/rustdoc-html/tuples.link_unit.html
rename to tests/rustdoc-html/codeblock/tuples.link_unit.html
diff --git a/tests/rustdoc-html/tuples.rs b/tests/rustdoc-html/codeblock/tuples.rs
similarity index 100%
rename from tests/rustdoc-html/tuples.rs
rename to tests/rustdoc-html/codeblock/tuples.rs
diff --git a/tests/rustdoc-html/deref-mut-35169-2.rs b/tests/rustdoc-html/deref/deref-mut-35169-2.rs
similarity index 100%
rename from tests/rustdoc-html/deref-mut-35169-2.rs
rename to tests/rustdoc-html/deref/deref-mut-35169-2.rs
diff --git a/tests/rustdoc-html/deref-mut-35169.rs b/tests/rustdoc-html/deref/deref-mut-35169.rs
similarity index 100%
rename from tests/rustdoc-html/deref-mut-35169.rs
rename to tests/rustdoc-html/deref/deref-mut-35169.rs
diff --git a/tests/rustdoc-html/link-on-path-with-generics.rs b/tests/rustdoc-html/jump-to-def/link-on-path-with-generics.rs
similarity index 100%
rename from tests/rustdoc-html/link-on-path-with-generics.rs
rename to tests/rustdoc-html/jump-to-def/link-on-path-with-generics.rs
diff --git a/tests/rustdoc-html/attributes-inlining-108281.rs b/tests/rustdoc-html/reexport/attributes-inlining-108281.rs
similarity index 100%
rename from tests/rustdoc-html/attributes-inlining-108281.rs
rename to tests/rustdoc-html/reexport/attributes-inlining-108281.rs
diff --git a/tests/rustdoc-html/attributes-re-export-2021-edition.rs b/tests/rustdoc-html/reexport/attributes-re-export-2021-edition.rs
similarity index 100%
rename from tests/rustdoc-html/attributes-re-export-2021-edition.rs
rename to tests/rustdoc-html/reexport/attributes-re-export-2021-edition.rs
diff --git a/tests/rustdoc-html/attributes-re-export.rs b/tests/rustdoc-html/reexport/attributes-re-export.rs
similarity index 100%
rename from tests/rustdoc-html/attributes-re-export.rs
rename to tests/rustdoc-html/reexport/attributes-re-export.rs
diff --git a/tests/rustdoc-html/glob-shadowing.rs b/tests/rustdoc-html/reexport/glob-shadowing.rs
similarity index 100%
rename from tests/rustdoc-html/glob-shadowing.rs
rename to tests/rustdoc-html/reexport/glob-shadowing.rs
diff --git a/tests/rustdoc-html/namespaces.rs b/tests/rustdoc-html/reexport/namespaces.rs
similarity index 100%
rename from tests/rustdoc-html/namespaces.rs
rename to tests/rustdoc-html/reexport/namespaces.rs
diff --git a/tests/rustdoc-html/logo-class-default.rs b/tests/rustdoc-html/sidebar/logo-class-default.rs
similarity index 100%
rename from tests/rustdoc-html/logo-class-default.rs
rename to tests/rustdoc-html/sidebar/logo-class-default.rs
diff --git a/tests/rustdoc-html/logo-class-rust.rs b/tests/rustdoc-html/sidebar/logo-class-rust.rs
similarity index 100%
rename from tests/rustdoc-html/logo-class-rust.rs
rename to tests/rustdoc-html/sidebar/logo-class-rust.rs
diff --git a/tests/rustdoc-html/logo-class.rs b/tests/rustdoc-html/sidebar/logo-class.rs
similarity index 100%
rename from tests/rustdoc-html/logo-class.rs
rename to tests/rustdoc-html/sidebar/logo-class.rs
diff --git a/triagebot.toml b/triagebot.toml
index fc9c43d2dbcae..4f2d0a262fdc1 100644
--- a/triagebot.toml
+++ b/triagebot.toml
@@ -1549,6 +1549,14 @@ cc = ["@mejrs"]
message = "Some changes occurred to diagnostic attributes."
cc = ["@mejrs"]
+[mentions."RELEASES.md"]
+message = """
+`RELEASES.md` was changed. Upon merging, each section will be automatically synced with its \
+corresponding GitHub releases, but **only from the `main` branch**.
+
+If it's not already the case, make sure to also merge the changes in the `main` branch.
+"""
+
# Content-based mentions
[mentions."miri"]