From 4d9a8b329d10dd43074761d377f81919ec099416 Mon Sep 17 00:00:00 2001 From: Adam Gemmell Date: Tue, 11 Aug 2026 10:13:47 +0100 Subject: [PATCH 01/11] Add test that d32 is not available by default --- tests/ui/asm/arm-high-dregs.baseline.stderr | 8 +++++++ tests/ui/asm/arm-high-dregs.rs | 25 +++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/ui/asm/arm-high-dregs.baseline.stderr create mode 100644 tests/ui/asm/arm-high-dregs.rs diff --git a/tests/ui/asm/arm-high-dregs.baseline.stderr b/tests/ui/asm/arm-high-dregs.baseline.stderr new file mode 100644 index 0000000000000..f9d9fea799135 --- /dev/null +++ b/tests/ui/asm/arm-high-dregs.baseline.stderr @@ -0,0 +1,8 @@ +error: register class `dreg` requires at least one of the following target features: d32, neon + --> $DIR/arm-high-dregs.rs:23:42 + | +LL | asm!("vmov.f64 d16, d0", in("d0") x, out("d16") y); + | ^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/asm/arm-high-dregs.rs b/tests/ui/asm/arm-high-dregs.rs new file mode 100644 index 0000000000000..b12562221811d --- /dev/null +++ b/tests/ui/asm/arm-high-dregs.rs @@ -0,0 +1,25 @@ +//@ add-minicore +//@ only-arm +//@ only-eabihf +//@ ignore-backends: gcc +//@ revisions: baseline target-cpu +//@ [baseline] check-fail +//@ [target-cpu] check-pass +//@ [target-cpu] compile-flags: -Ctarget-cpu=cortex-a5 + +// As well as the error message, this also tests that d32 is not enabled by default on arm hardfloat +// targets and that it can be re-enabled by target-cpu. + +#![feature(f16, no_core)] +#![crate_type = "rlib"] +#![no_core] + +extern crate minicore; +use minicore::*; + +#[no_mangle] +pub unsafe fn high(x: f64) { + let y: f64; + asm!("vmov.f64 d16, d0", in("d0") x, out("d16") y); + //[baseline]~^ ERROR register class `dreg` requires at least one of the following target features: d32, neon +} From 454090a81ac1628eb141fbd183c0e2fddeb36237 Mon Sep 17 00:00:00 2001 From: Adam Gemmell Date: Thu, 3 Sep 2026 15:41:36 +0100 Subject: [PATCH 02/11] Move armv7 targets to the generic LLVM target --- .../rustc_target/src/spec/targets/armv7_linux_androideabi.rs | 4 ++-- .../rustc_target/src/spec/targets/armv7_unknown_freebsd.rs | 4 ++-- .../src/spec/targets/armv7_unknown_linux_gnueabihf.rs | 4 ++-- .../src/spec/targets/armv7_unknown_linux_musleabihf.rs | 4 ++-- .../src/spec/targets/armv7_unknown_linux_uclibceabihf.rs | 2 +- .../src/spec/targets/armv7_unknown_netbsd_eabihf.rs | 4 ++-- .../rustc_target/src/spec/targets/armv7_wrs_vxworks_eabihf.rs | 4 ++-- .../src/spec/targets/armv7a_kmc_solid_asp3_eabihf.rs | 4 ++-- compiler/rustc_target/src/spec/targets/armv7a_none_eabihf.rs | 4 ++-- .../rustc_target/src/spec/targets/thumbv7a_none_eabihf.rs | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/compiler/rustc_target/src/spec/targets/armv7_linux_androideabi.rs b/compiler/rustc_target/src/spec/targets/armv7_linux_androideabi.rs index 99adc85947aba..109de4dfe313a 100644 --- a/compiler/rustc_target/src/spec/targets/armv7_linux_androideabi.rs +++ b/compiler/rustc_target/src/spec/targets/armv7_linux_androideabi.rs @@ -15,7 +15,7 @@ pub(crate) fn target() -> Target { let mut base = base::android::opts(); base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-march=armv7-a"]); Target { - llvm_target: "armv7-none-linux-android".into(), + llvm_target: "arm-none-linux-android".into(), metadata: TargetMetadata { description: Some("Armv7-A Android".into()), tier: Some(2), @@ -28,7 +28,7 @@ pub(crate) fn target() -> Target { options: TargetOptions { cfg_abi: CfgAbi::Eabi, llvm_floatabi: Some(FloatAbi::Soft), - features: "+v7,+thumb-mode,+thumb2,+vfp3d16,-neon".into(), + features: "+v7,+db,+dsp,+aclass,+perfmon,+thumb-mode,+thumb2,+vfp3d16".into(), supported_sanitizers: SanitizerSet::ADDRESS, max_atomic_width: Some(64), ..base diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_freebsd.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_freebsd.rs index cd6d8b76f1a99..91660d0b1ba76 100644 --- a/compiler/rustc_target/src/spec/targets/armv7_unknown_freebsd.rs +++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_freebsd.rs @@ -2,7 +2,7 @@ use crate::spec::{Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions, pub(crate) fn target() -> Target { Target { - llvm_target: "armv7-unknown-freebsd-gnueabihf".into(), + llvm_target: "arm-unknown-freebsd-gnueabihf".into(), metadata: TargetMetadata { description: Some("Armv7-A FreeBSD".into()), tier: Some(3), @@ -15,7 +15,7 @@ pub(crate) fn target() -> Target { options: TargetOptions { cfg_abi: CfgAbi::EabiHf, llvm_floatabi: Some(FloatAbi::Hard), - features: "+v7,+vfp3d16,+thumb2,-neon".into(), + features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+thumb2".into(), max_atomic_width: Some(64), mcount: "\u{1}__gnu_mcount_nc".into(), ..base::freebsd::opts() diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabihf.rs index 8bf3dfd247229..4cce5f35afd4e 100644 --- a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabihf.rs +++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabihf.rs @@ -7,7 +7,7 @@ use crate::spec::{ pub(crate) fn target() -> Target { Target { - llvm_target: "armv7-unknown-linux-gnueabihf".into(), + llvm_target: "arm-unknown-linux-gnueabihf".into(), metadata: TargetMetadata { description: Some("Armv7-A Linux, hardfloat (kernel 3.2, glibc 2.17)".into()), tier: Some(2), @@ -21,7 +21,7 @@ pub(crate) fn target() -> Target { cfg_abi: CfgAbi::EabiHf, llvm_floatabi: Some(FloatAbi::Hard), // Info about features at https://wiki.debian.org/ArmHardFloatPort - features: "+v7,+vfp3d16,+thumb2,-neon".into(), + features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+thumb2".into(), max_atomic_width: Some(64), mcount: "\u{1}__gnu_mcount_nc".into(), llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()), diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs index 6ce45de909a8b..39c45161082ab 100644 --- a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs +++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs @@ -4,7 +4,7 @@ use crate::spec::{Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions, pub(crate) fn target() -> Target { Target { - llvm_target: "armv7-unknown-linux-musleabihf".into(), + llvm_target: "arm-unknown-linux-musleabihf".into(), metadata: TargetMetadata { description: Some("Armv7-A Linux with musl 1.2.5, hardfloat".into()), tier: Some(2), @@ -20,7 +20,7 @@ pub(crate) fn target() -> Target { options: TargetOptions { cfg_abi: CfgAbi::EabiHf, llvm_floatabi: Some(FloatAbi::Hard), - features: "+v7,+vfp3d16,+thumb2,-neon".into(), + features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+thumb2".into(), max_atomic_width: Some(64), mcount: "\u{1}mcount".into(), // FIXME(compiler-team#422): musl targets should be dynamically linked by default. diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_uclibceabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_uclibceabihf.rs index 63845a1a555c5..f585f890cb2f9 100644 --- a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_uclibceabihf.rs +++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_uclibceabihf.rs @@ -19,7 +19,7 @@ pub(crate) fn target() -> Target { options: TargetOptions { // Info about features at https://wiki.debian.org/ArmHardFloatPort - features: "+v7,+vfp3d16,+thumb2,-neon".into(), + features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+thumb2".into(), cpu: "generic".into(), max_atomic_width: Some(64), mcount: "_mcount".into(), diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_netbsd_eabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_netbsd_eabihf.rs index 4000e395c5bcb..2c4582871d410 100644 --- a/compiler/rustc_target/src/spec/targets/armv7_unknown_netbsd_eabihf.rs +++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_netbsd_eabihf.rs @@ -2,7 +2,7 @@ use crate::spec::{Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions, pub(crate) fn target() -> Target { Target { - llvm_target: "armv7-unknown-netbsdelf-eabihf".into(), + llvm_target: "arm-unknown-netbsdelf-eabihf".into(), metadata: TargetMetadata { description: Some("Armv7-A NetBSD w/hard-float".into()), tier: Some(3), @@ -15,7 +15,7 @@ pub(crate) fn target() -> Target { options: TargetOptions { cfg_abi: CfgAbi::EabiHf, llvm_floatabi: Some(FloatAbi::Hard), - features: "+v7,+vfp3d16,+thumb2,-neon".into(), + features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+thumb2".into(), max_atomic_width: Some(64), mcount: "__mcount".into(), ..base::netbsd::opts() diff --git a/compiler/rustc_target/src/spec/targets/armv7_wrs_vxworks_eabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_wrs_vxworks_eabihf.rs index 63f82a0d7e68d..5a1798263cd48 100644 --- a/compiler/rustc_target/src/spec/targets/armv7_wrs_vxworks_eabihf.rs +++ b/compiler/rustc_target/src/spec/targets/armv7_wrs_vxworks_eabihf.rs @@ -2,7 +2,7 @@ use crate::spec::{Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions, pub(crate) fn target() -> Target { Target { - llvm_target: "armv7-unknown-linux-gnueabihf".into(), + llvm_target: "arm-unknown-linux-gnueabihf".into(), metadata: TargetMetadata { description: Some("Armv7-A for VxWorks".into()), tier: Some(3), @@ -16,7 +16,7 @@ pub(crate) fn target() -> Target { cfg_abi: CfgAbi::EabiHf, llvm_floatabi: Some(FloatAbi::Hard), // Info about features at https://wiki.debian.org/ArmHardFloatPort - features: "+v7,+vfp3d16,+thumb2,-neon".into(), + features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+thumb2".into(), max_atomic_width: Some(64), ..base::vxworks::opts() }, diff --git a/compiler/rustc_target/src/spec/targets/armv7a_kmc_solid_asp3_eabihf.rs b/compiler/rustc_target/src/spec/targets/armv7a_kmc_solid_asp3_eabihf.rs index b59ce32b48e04..eac437ffdf2a5 100644 --- a/compiler/rustc_target/src/spec/targets/armv7a_kmc_solid_asp3_eabihf.rs +++ b/compiler/rustc_target/src/spec/targets/armv7a_kmc_solid_asp3_eabihf.rs @@ -5,7 +5,7 @@ use crate::spec::{ pub(crate) fn target() -> Target { let base = base::solid::opts(); Target { - llvm_target: "armv7a-none-eabihf".into(), + llvm_target: "arm-none-eabihf".into(), metadata: TargetMetadata { description: Some("Arm SOLID with TOPPERS/ASP3, hardfloat".into()), tier: Some(3), @@ -19,7 +19,7 @@ pub(crate) fn target() -> Target { cfg_abi: CfgAbi::EabiHf, llvm_floatabi: Some(FloatAbi::Hard), linker: Some("arm-kmc-eabi-gcc".into()), - features: "+v7,+vfp3d16,+thumb2,-neon".into(), + features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+thumb2".into(), relocation_model: RelocModel::Static, disable_redzone: true, max_atomic_width: Some(64), diff --git a/compiler/rustc_target/src/spec/targets/armv7a_none_eabihf.rs b/compiler/rustc_target/src/spec/targets/armv7a_none_eabihf.rs index cbeb409110ff7..baca5c7c0b024 100644 --- a/compiler/rustc_target/src/spec/targets/armv7a_none_eabihf.rs +++ b/compiler/rustc_target/src/spec/targets/armv7a_none_eabihf.rs @@ -4,7 +4,7 @@ use crate::spec::{Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions, pub(crate) fn target() -> Target { Target { - llvm_target: "armv7a-none-eabihf".into(), + llvm_target: "arm-none-eabihf".into(), metadata: TargetMetadata { description: Some("Bare Armv7-A, hardfloat".into()), tier: Some(2), @@ -17,7 +17,7 @@ pub(crate) fn target() -> Target { options: TargetOptions { cfg_abi: CfgAbi::EabiHf, llvm_floatabi: Some(FloatAbi::Hard), - features: "+vfp3d16,-neon,+strict-align".into(), + features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+strict-align".into(), max_atomic_width: Some(64), has_thumb_interworking: true, ..base::arm_none::opts() diff --git a/compiler/rustc_target/src/spec/targets/thumbv7a_none_eabihf.rs b/compiler/rustc_target/src/spec/targets/thumbv7a_none_eabihf.rs index 4baa73c3cdb8b..0b5d8afb170cd 100644 --- a/compiler/rustc_target/src/spec/targets/thumbv7a_none_eabihf.rs +++ b/compiler/rustc_target/src/spec/targets/thumbv7a_none_eabihf.rs @@ -4,7 +4,7 @@ use crate::spec::{Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions, pub(crate) fn target() -> Target { Target { - llvm_target: "thumbv7a-none-eabihf".into(), + llvm_target: "thumb-none-eabihf".into(), metadata: TargetMetadata { description: Some("Thumb-mode Bare Armv7-A, hardfloat".into()), tier: Some(2), @@ -17,7 +17,7 @@ pub(crate) fn target() -> Target { options: TargetOptions { cfg_abi: CfgAbi::EabiHf, llvm_floatabi: Some(FloatAbi::Hard), - features: "+vfp3d16,-neon,+strict-align".into(), + features: "+v7,+db,+dsp,+aclass,+perfmon,+vfp3d16,+strict-align".into(), max_atomic_width: Some(64), has_thumb_interworking: true, ..base::arm_none::opts() From c701054fcef7b0fcdfcb8105eabf7c45ae16cda6 Mon Sep 17 00:00:00 2001 From: Adam Gemmell Date: Tue, 11 Aug 2026 17:19:28 +0100 Subject: [PATCH 03/11] Fix VFP levels docs for armv7a-none-eabi --- src/doc/rustc/src/platform-support/armv7a-none-eabi.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/rustc/src/platform-support/armv7a-none-eabi.md b/src/doc/rustc/src/platform-support/armv7a-none-eabi.md index 1ad81f264cbf4..3b927a573e30c 100644 --- a/src/doc/rustc/src/platform-support/armv7a-none-eabi.md +++ b/src/doc/rustc/src/platform-support/armv7a-none-eabi.md @@ -49,10 +49,10 @@ disabled as needed with `-C target-feature=(+/-)`. In general, the following four combinations are possible: -- VFPv3-D16, target feature `+vfp3` and `-d32` -- VFPv3-D32, target feature `+vfp3` and `+d32` -- VFPv4-D16, target feature `+vfp4` and `-d32` -- VFPv4-D32, target feature `+vfp4` and `+d32` +- VFPv3-D16, target default +- VFPv3-D32, target feature `+d32` +- VFPv4-D16, llvm target feature `+vfp4d16` +- VFPv4-D32, target feature `+vfp4` An Armv7-A processor may optionally include a NEON hardware unit which provides Single Instruction Multiple Data (SIMD) operations. The From 55469d6a61837d4c8d59dc5e973804e42b86ae4b Mon Sep 17 00:00:00 2001 From: Adam Gemmell Date: Fri, 4 Sep 2026 12:54:24 +0100 Subject: [PATCH 04/11] Remove the last -d32 from armv6 HF targets --- compiler/rustc_target/src/spec/targets/armv6_none_eabihf.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/targets/armv6_none_eabihf.rs b/compiler/rustc_target/src/spec/targets/armv6_none_eabihf.rs index d4886ee16e91a..8c3cf553adaf8 100644 --- a/compiler/rustc_target/src/spec/targets/armv6_none_eabihf.rs +++ b/compiler/rustc_target/src/spec/targets/armv6_none_eabihf.rs @@ -18,7 +18,7 @@ pub(crate) fn target() -> Target { cfg_abi: CfgAbi::EabiHf, llvm_floatabi: Some(FloatAbi::Hard), asm_args: cvs!["-mthumb-interwork", "-march=armv6", "-mlittle-endian",], - features: "+strict-align,+v6k,+vfp2,-d32".into(), + features: "+strict-align,+v6k,+vfp2".into(), atomic_cas: true, has_thumb_interworking: true, // LDREXD/STREXD available as of ARMv6K From 4750ec7ba03a5499e9777a06172d00378a5649a5 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Fri, 11 Sep 2026 14:35:59 +0000 Subject: [PATCH 05/11] Fix `*_trailing_sep` for Windows verbatim paths --- library/std/src/path.rs | 6 ++++-- library/std/tests/path.rs | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 141bc72fb2e42..f06625613ec00 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -2983,7 +2983,8 @@ impl Path { #[must_use] #[inline] pub fn has_trailing_sep(&self) -> bool { - self.as_os_str().as_encoded_bytes().last().copied().is_some_and(is_sep_byte) + let comps = self.components(); + self.as_os_str().as_encoded_bytes().last().copied().is_some_and(|b| comps.is_sep_byte(b)) } /// Ensures that a path has a trailing [separator](MAIN_SEPARATOR), @@ -3034,10 +3035,11 @@ impl Path { #[must_use] #[inline] pub fn trim_trailing_sep(&self) -> &Path { + let comps = self.components(); if self.has_trailing_sep() && (!self.has_root() || self.parent().is_some()) { let mut bytes = self.inner.as_encoded_bytes(); while let Some((last, init)) = bytes.split_last() - && is_sep_byte(*last) + && comps.is_sep_byte(*last) { bytes = init; } diff --git a/library/std/tests/path.rs b/library/std/tests/path.rs index 4d42437fbd871..10bfe9eb2bd6c 100644 --- a/library/std/tests/path.rs +++ b/library/std/tests/path.rs @@ -2597,3 +2597,20 @@ fn test_trim_trailing_sep() { assert_eq!(Path::new("c:..\\\\").trim_trailing_sep().as_os_str(), OsStr::new("c:..")); } } + +#[cfg(windows)] +#[test] +fn trailing_sep_verbatim() { + assert_eq!(Path::new(r"\\?\C:\path").has_trailing_sep(), false); + assert_eq!(Path::new(r"\\?\C:\path/").has_trailing_sep(), false); + assert_eq!(Path::new(r"\\?\C:\path\").has_trailing_sep(), true); + assert_eq!(Path::new(r"\\?\C:\").has_trailing_sep(), true); + assert_eq!(Path::new(r"\\?\C:/").has_trailing_sep(), false); + + assert_eq!(Path::new(r"\\?\C:\path").trim_trailing_sep(), Path::new(r"\\?\C:\path")); + assert_eq!(Path::new(r"\\?\C:\path/").trim_trailing_sep(), Path::new(r"\\?\C:\path/")); + assert_eq!(Path::new(r"\\?\C:\path\").trim_trailing_sep(), Path::new(r"\\?\C:\path")); + assert_eq!(Path::new(r"\\?\C:\path/\\\").trim_trailing_sep(), Path::new(r"\\?\C:\path/")); + assert_eq!(Path::new(r"\\?\C:\").trim_trailing_sep(), Path::new(r"\\?\C:\")); + assert_eq!(Path::new(r"\\?\C:/").trim_trailing_sep(), Path::new(r"\\?\C:/")); +} From 0f916bb57936422a46d62c812d1ce974ce0f1e8e Mon Sep 17 00:00:00 2001 From: Mikhail Baykov Date: Sun, 23 Aug 2026 09:22:33 -0400 Subject: [PATCH 06/11] std: Make a lot of pub items crate private instead (ignore os/sys) Most of them don't need to be public, but there are scenarios where thing is private on one platform but public on the other, so having a lint on all the time gets complicated. Added #![warn(unreachable_pub)] in library/std/src/lib.rs Added #[allow(unreachable_pub)] on top of std::os and std::sys specifically. --- library/std/src/collections/hash/mod.rs | 4 ++-- library/std/src/fs/tests.rs | 2 +- library/std/src/io/stdio.rs | 2 +- library/std/src/lib.rs | 3 +++ library/std/src/panicking.rs | 10 +++++----- library/std/src/process/tests.rs | 8 ++++---- library/std/src/sync/mpmc/context.rs | 14 +++++++------- library/std/src/sync/mpmc/select.rs | 8 ++++---- library/std/src/sync/mpmc/utils.rs | 12 ++++++------ library/std/src/sync/mpmc/waker.rs | 2 +- library/std/src/sync/poison.rs | 16 ++++++++-------- library/std/src/test_helpers.rs | 8 ++++---- library/std/src/thread/lifecycle.rs | 2 +- library/std/src/thread/thread.rs | 4 ++-- 14 files changed, 49 insertions(+), 46 deletions(-) diff --git a/library/std/src/collections/hash/mod.rs b/library/std/src/collections/hash/mod.rs index 348820af54bff..0476b0206f3d7 100644 --- a/library/std/src/collections/hash/mod.rs +++ b/library/std/src/collections/hash/mod.rs @@ -1,4 +1,4 @@ //! Unordered containers, implemented as hash-tables -pub mod map; -pub mod set; +pub(crate) mod map; +pub(crate) mod set; diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index dab1df38aa1f5..148f1c32b08b9 100644 --- a/library/std/src/fs/tests.rs +++ b/library/std/src/fs/tests.rs @@ -45,7 +45,7 @@ macro_rules! error_contains { // have permission, and return otherwise. This way, we still don't run these // tests most of the time, but at least we do if the user has the right // permissions. -pub fn got_symlink_permission(tmpdir: &TempDir) -> bool { +pub(crate) fn got_symlink_permission(tmpdir: &TempDir) -> bool { if cfg!(not(windows)) || env::var_os("CI").is_some() { return true; } diff --git a/library/std/src/io/stdio.rs b/library/std/src/io/stdio.rs index b104ea69cd1fc..527671442fb72 100644 --- a/library/std/src/io/stdio.rs +++ b/library/std/src/io/stdio.rs @@ -726,7 +726,7 @@ pub fn stdout() -> Stdout { // Flush the data and disable buffering during shutdown // by replacing the line writer by one with zero // buffering capacity. -pub fn cleanup() { +pub(crate) fn cleanup() { let mut initialized = false; let stdout = STDOUT.get_or_init(|| { initialized = true; diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 18ff174af2375..5f98aa54a6620 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -241,6 +241,7 @@ // Lints: #![warn(deprecated_in_future)] #![warn(missing_docs)] +#![warn(unreachable_pub)] #![warn(missing_debug_implementations)] #![allow(explicit_outlives_requirements)] #![allow(unused_lifetimes)] @@ -640,6 +641,7 @@ pub mod hash; pub mod io; pub mod net; pub mod num; +#[allow(unreachable_pub)] pub mod os; pub mod panic; #[unstable(feature = "pattern_type_macro", issue = "123646")] @@ -730,6 +732,7 @@ pub mod arch { #[stable(feature = "simd_x86", since = "1.27.0")] pub use std_detect::is_x86_feature_detected; +#[allow(unreachable_pub)] mod sys; pub mod alloc; diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs index 5a4684a973942..f69e0a749f579 100644 --- a/library/std/src/panicking.rs +++ b/library/std/src/panicking.rs @@ -41,7 +41,7 @@ use crate::{fmt, intrinsics, process, thread}; #[doc(hidden)] #[allow(dead_code)] #[used(compiler)] -pub static EMPTY_PANIC: fn(&'static str) -> ! = +pub(crate) static EMPTY_PANIC: fn(&'static str) -> ! = begin_panic::<&'static str> as fn(&'static str) -> !; // Binary interface to the panic runtime that the standard library depends on. @@ -495,7 +495,7 @@ pub unsafe fn catch_unwind R>(f: F) -> Result R>(f: F) -> Result> { +pub(crate) unsafe fn catch_unwind R>(f: F) -> Result> { union Data { f: ManuallyDrop, r: ManuallyDrop, @@ -599,14 +599,14 @@ pub unsafe fn catch_unwind R>(f: F) -> Result bool { +pub(crate) fn panicking() -> bool { !panic_count::count_is_zero() } /// Entry point of panics from the core crate (`panic_impl` lang item). #[cfg(not(any(test, doctest)))] #[panic_handler] -pub fn panic_handler(info: &core::panic::PanicInfo<'_>) -> ! { +pub(crate) fn panic_handler(info: &core::panic::PanicInfo<'_>) -> ! { struct FormatStringPayload<'a> { inner: &'a core::panic::PanicMessage<'a>, string: Option, @@ -839,7 +839,7 @@ fn panic_with_hook( /// This is the entry point for `resume_unwind`. /// It just forwards the payload to the panic runtime. #[cfg_attr(panic = "immediate-abort", inline)] -pub fn resume_unwind(payload: Box) -> ! { +pub(crate) fn resume_unwind(payload: Box) -> ! { if let Some(must_abort) = panic_count::increase(false) { match must_abort { panic_count::MustAbort::PanicInHook => { diff --git a/library/std/src/process/tests.rs b/library/std/src/process/tests.rs index 35ce30f1146e4..e31cb002c0265 100644 --- a/library/std/src/process/tests.rs +++ b/library/std/src/process/tests.rs @@ -95,7 +95,7 @@ fn signal_reported_right() { } } -pub fn run_output(mut cmd: Command) -> String { +pub(crate) fn run_output(mut cmd: Command) -> String { let p = cmd.spawn(); assert!(p.is_ok()); let mut p = p.unwrap(); @@ -361,18 +361,18 @@ fn test_wait_with_output_once() { } #[cfg(all(unix, not(target_os = "android")))] -pub fn env_cmd() -> Command { +pub(crate) fn env_cmd() -> Command { Command::new("env") } #[cfg(target_os = "android")] -pub fn env_cmd() -> Command { +pub(crate) fn env_cmd() -> Command { let mut cmd = Command::new("/system/bin/sh"); cmd.arg("-c").arg("set"); cmd } #[cfg(windows)] -pub fn env_cmd() -> Command { +pub(crate) fn env_cmd() -> Command { let mut cmd = Command::new("cmd"); cmd.arg("/c").arg("set"); cmd diff --git a/library/std/src/sync/mpmc/context.rs b/library/std/src/sync/mpmc/context.rs index 6b2f4cb6ffd29..b4fee60a574ff 100644 --- a/library/std/src/sync/mpmc/context.rs +++ b/library/std/src/sync/mpmc/context.rs @@ -11,7 +11,7 @@ use crate::time::Instant; /// Thread-local context. #[derive(Debug, Clone)] -pub struct Context { +pub(crate) struct Context { inner: Arc, } @@ -34,7 +34,7 @@ struct Inner { impl Context { /// Creates a new context for the duration of the closure. #[inline] - pub fn with(f: F) -> R + pub(crate) fn with(f: F) -> R where F: FnOnce(&Context) -> R, { @@ -86,7 +86,7 @@ impl Context { /// /// On failure, the previously selected operation is returned. #[inline] - pub fn try_select(&self, select: Selected) -> Result<(), Selected> { + pub(crate) fn try_select(&self, select: Selected) -> Result<(), Selected> { self.inner .select .compare_exchange( @@ -103,7 +103,7 @@ impl Context { /// /// This method must be called after `try_select` succeeds and there is a packet to provide. #[inline] - pub fn store_packet(&self, packet: *mut ()) { + pub(crate) fn store_packet(&self, packet: *mut ()) { if !packet.is_null() { self.inner.packet.store(packet, Ordering::Release); } @@ -116,7 +116,7 @@ impl Context { /// # Safety /// This may only be called from the thread this `Context` belongs to. #[inline] - pub unsafe fn wait_until(&self, deadline: Option) -> Selected { + pub(crate) unsafe fn wait_until(&self, deadline: Option) -> Selected { loop { // Check whether an operation has been selected. let sel = Selected::from(self.inner.select.load(Ordering::Acquire)); @@ -147,13 +147,13 @@ impl Context { /// Unparks the thread this context belongs to. #[inline] - pub fn unpark(&self) { + pub(crate) fn unpark(&self) { self.inner.thread.unpark(); } /// Returns the id of the thread this context belongs to. #[inline] - pub fn thread_id(&self) -> usize { + pub(crate) fn thread_id(&self) -> usize { self.inner.thread_id } } diff --git a/library/std/src/sync/mpmc/select.rs b/library/std/src/sync/mpmc/select.rs index ff537aa686157..60f81d863ae4f 100644 --- a/library/std/src/sync/mpmc/select.rs +++ b/library/std/src/sync/mpmc/select.rs @@ -3,7 +3,7 @@ /// /// Each field contains data associated with a specific channel flavor. #[derive(Debug, Default)] -pub struct Token { +pub(crate) struct Token { pub(crate) array: super::array::ArrayToken, pub(crate) list: super::list::ListToken, #[allow(dead_code)] @@ -12,7 +12,7 @@ pub struct Token { /// Identifier associated with an operation by a specific thread on a specific channel. #[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub struct Operation(usize); +pub(crate) struct Operation(usize); impl Operation { /// Creates an operation identifier from a mutable reference. @@ -21,7 +21,7 @@ impl Operation { /// reference should point to a variable that is specific to the thread and the operation, /// and is alive for the entire duration of a blocking operation. #[inline] - pub fn hook(r: &mut T) -> Operation { + pub(crate) fn hook(r: &mut T) -> Operation { let val = (r as *mut T).addr(); // Make sure that the pointer address doesn't equal the numerical representation of // `Selected::{Waiting, Aborted, Disconnected}`. @@ -32,7 +32,7 @@ impl Operation { /// Current state of a blocking operation. #[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum Selected { +pub(crate) enum Selected { /// Still waiting for an operation. Waiting, diff --git a/library/std/src/sync/mpmc/utils.rs b/library/std/src/sync/mpmc/utils.rs index e3bcb149f648b..5a9bc7af6c36d 100644 --- a/library/std/src/sync/mpmc/utils.rs +++ b/library/std/src/sync/mpmc/utils.rs @@ -67,13 +67,13 @@ use crate::ops::{Deref, DerefMut}; )), repr(align(64)) )] -pub struct CachePadded { +pub(crate) struct CachePadded { value: T, } impl CachePadded { /// Pads and aligns a value to the length of a cache line. - pub fn new(value: T) -> CachePadded { + pub(crate) fn new(value: T) -> CachePadded { CachePadded:: { value } } } @@ -95,13 +95,13 @@ impl DerefMut for CachePadded { const SPIN_LIMIT: u32 = 6; /// Performs quadratic backoff in spin loops. -pub struct Backoff { +pub(crate) struct Backoff { step: Cell, } impl Backoff { /// Creates a new `Backoff`. - pub fn new() -> Self { + pub(crate) fn new() -> Self { Backoff { step: Cell::new(0) } } @@ -110,7 +110,7 @@ impl Backoff { /// This method should be used for retrying an operation because another thread made /// progress. i.e. on CAS failure. #[inline] - pub fn spin_light(&self) { + pub(crate) fn spin_light(&self) { let step = self.step.get().min(SPIN_LIMIT); for _ in 0..step.pow(2) { crate::hint::spin_loop(); @@ -123,7 +123,7 @@ impl Backoff { /// /// This method should be used in blocking loops where parking the thread is not an option. #[inline] - pub fn spin_heavy(&self) { + pub(crate) fn spin_heavy(&self) { if self.step.get() <= SPIN_LIMIT { for _ in 0..self.step.get().pow(2) { crate::hint::spin_loop() diff --git a/library/std/src/sync/mpmc/waker.rs b/library/std/src/sync/mpmc/waker.rs index 4216fb7ac5902..de913f0d421cc 100644 --- a/library/std/src/sync/mpmc/waker.rs +++ b/library/std/src/sync/mpmc/waker.rs @@ -201,7 +201,7 @@ impl Drop for SyncWaker { /// Returns a unique id for the current thread. #[inline] -pub fn current_thread_id() -> usize { +pub(crate) fn current_thread_id() -> usize { // `u8` is not drop so this variable will be available during thread destruction, // whereas `thread::current()` would not be thread_local! { static DUMMY: u8 = const { 0 } } diff --git a/library/std/src/sync/poison.rs b/library/std/src/sync/poison.rs index 3c32ec34dee5b..62d4c2754effe 100644 --- a/library/std/src/sync/poison.rs +++ b/library/std/src/sync/poison.rs @@ -97,7 +97,7 @@ pub(crate) struct Flag { impl Flag { #[inline] - pub const fn new() -> Flag { + pub(crate) const fn new() -> Flag { Flag { #[cfg(panic = "unwind")] failed: AtomicBool::new(false), @@ -106,13 +106,13 @@ impl Flag { /// Checks the flag for an unguarded borrow, where we only care about existing poison. #[inline] - pub fn borrow(&self) -> LockResult<()> { + pub(crate) fn borrow(&self) -> LockResult<()> { if self.get() { Err(PoisonError::new(())) } else { Ok(()) } } /// Checks the flag for a guarded borrow, where we may also set poison when `done`. #[inline] - pub fn guard(&self) -> LockResult { + pub(crate) fn guard(&self) -> LockResult { let ret = Guard { #[cfg(panic = "unwind")] panicking: thread::panicking(), @@ -122,7 +122,7 @@ impl Flag { #[inline] #[cfg(panic = "unwind")] - pub fn done(&self, guard: &Guard) { + pub(crate) fn done(&self, guard: &Guard) { if !guard.panicking && thread::panicking() { self.failed.store(true, Ordering::Relaxed); } @@ -130,22 +130,22 @@ impl Flag { #[inline] #[cfg(not(panic = "unwind"))] - pub fn done(&self, _guard: &Guard) {} + pub(crate) fn done(&self, _guard: &Guard) {} #[inline] #[cfg(panic = "unwind")] - pub fn get(&self) -> bool { + pub(crate) fn get(&self) -> bool { self.failed.load(Ordering::Relaxed) } #[inline(always)] #[cfg(not(panic = "unwind"))] - pub fn get(&self) -> bool { + pub(crate) fn get(&self) -> bool { false } #[inline] - pub fn clear(&self) { + pub(crate) fn clear(&self) { #[cfg(panic = "unwind")] self.failed.store(false, Ordering::Relaxed) } diff --git a/library/std/src/test_helpers.rs b/library/std/src/test_helpers.rs index 7c20f38c863b6..5690a40648ff2 100644 --- a/library/std/src/test_helpers.rs +++ b/library/std/src/test_helpers.rs @@ -27,15 +27,15 @@ pub(crate) fn test_rng() -> rand_xorshift::XorShiftRng { SeedableRng::from_seed(seed) } -pub struct TempDir(PathBuf); +pub(crate) struct TempDir(PathBuf); impl TempDir { - pub fn join(&self, path: &str) -> PathBuf { + pub(crate) fn join(&self, path: &str) -> PathBuf { let TempDir(ref p) = *self; p.join(path) } - pub fn path(&self) -> &Path { + pub(crate) fn path(&self) -> &Path { let TempDir(ref p) = *self; p } @@ -56,7 +56,7 @@ impl Drop for TempDir { } #[track_caller] // for `test_rng` -pub fn tmpdir() -> TempDir { +pub(crate) fn tmpdir() -> TempDir { let p = env::temp_dir(); let mut r = test_rng(); let ret = p.join(&format!("rust-{}", r.next_u32())); diff --git a/library/std/src/thread/lifecycle.rs b/library/std/src/thread/lifecycle.rs index 0dec359ccaec6..c22b97c39ecd5 100644 --- a/library/std/src/thread/lifecycle.rs +++ b/library/std/src/thread/lifecycle.rs @@ -125,7 +125,7 @@ pub(crate) struct ThreadInit { impl ThreadInit { /// Initialize the 'current thread' mechanism on this thread, returning the /// Rust entry point. - pub fn init(self: Box) -> Box { + pub(crate) fn init(self: Box) -> Box { // Set the current thread before any (de)allocations on the global allocator occur, // so that it may call std::thread::current() in its implementation. This is also // why we take Box, to ensure the Box is not destroyed until after this point. diff --git a/library/std/src/thread/thread.rs b/library/std/src/thread/thread.rs index d70c244c65d90..bfcf0fa4953d2 100644 --- a/library/std/src/thread/thread.rs +++ b/library/std/src/thread/thread.rs @@ -28,11 +28,11 @@ mod thread_name_string { } impl ThreadNameString { - pub fn as_cstr(&self) -> &CStr { + pub(crate) fn as_cstr(&self) -> &CStr { &self.inner } - pub fn as_str(&self) -> &str { + pub(crate) fn as_str(&self) -> &str { // SAFETY: `ThreadNameString` is guaranteed to be UTF-8. unsafe { str::from_utf8_unchecked(self.inner.to_bytes()) } } From 56aed553a063f918388af3a4f32147a7e4ae20a3 Mon Sep 17 00:00:00 2001 From: kulinsky Date: Mon, 14 Sep 2026 19:08:04 +0500 Subject: [PATCH 07/11] Respect do_not_recommend for a single impl candidate Add regression test for do_not_recommend on a single impl candidate --- .../traits/fulfillment_errors.rs | 4 +++- .../do_not_recommend/single-impl-candidate.rs | 21 ++++++++++++++++++ .../single-impl-candidate.stderr | 22 +++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 tests/ui/diagnostic_namespace/do_not_recommend/single-impl-candidate.rs create mode 100644 tests/ui/diagnostic_namespace/do_not_recommend/single-impl-candidate.stderr diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs index 7ee4481d12431..72e56ef428a0b 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs @@ -2214,7 +2214,9 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { impl_candidates }; - if let [single] = &impl_candidates { + if let [single] = &impl_candidates + && !self.tcx.do_not_recommend_impl(single.impl_def_id) + { let self_ty = trait_pred.skip_binder().self_ty(); if !self_ty.has_escaping_bound_vars() { let self_ty = self.tcx.instantiate_bound_regions_with_erased(trait_pred.self_ty()); diff --git a/tests/ui/diagnostic_namespace/do_not_recommend/single-impl-candidate.rs b/tests/ui/diagnostic_namespace/do_not_recommend/single-impl-candidate.rs new file mode 100644 index 0000000000000..313dca87464dd --- /dev/null +++ b/tests/ui/diagnostic_namespace/do_not_recommend/single-impl-candidate.rs @@ -0,0 +1,21 @@ +//@ reference: attributes.diagnostic.do_not_recommend.intro + +pub struct Internal; + +#[diagnostic::do_not_recommend] +impl From for &str { + fn from(_: Internal) -> Self { + "" + } +} + +fn foo<'a, T>(_t: T) +where + T: Into<&'a str>, +{ +} + +fn main() { + foo(String::new()); + //~^ ERROR the trait bound `&str: From` is not satisfied +} diff --git a/tests/ui/diagnostic_namespace/do_not_recommend/single-impl-candidate.stderr b/tests/ui/diagnostic_namespace/do_not_recommend/single-impl-candidate.stderr new file mode 100644 index 0000000000000..a0d0e73a1172b --- /dev/null +++ b/tests/ui/diagnostic_namespace/do_not_recommend/single-impl-candidate.stderr @@ -0,0 +1,22 @@ +error[E0277]: the trait bound `&str: From` is not satisfied + --> $DIR/single-impl-candidate.rs:19:9 + | +LL | foo(String::new()); + | --- ^^^^^^^^^^^^^ the trait `From` is not implemented for `&str` + | | + | required by a bound introduced by this call + | + = note: to coerce a `String` into a `&str`, use `&*` as a prefix + = note: required for `String` to implement `Into<&str>` +note: required by a bound in `foo` + --> $DIR/single-impl-candidate.rs:14:8 + | +LL | fn foo<'a, T>(_t: T) + | --- required by a bound in this function +LL | where +LL | T: Into<&'a str>, + | ^^^^^^^^^^^^^ required by this bound in `foo` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. From 711a32b1bde0de0f26628d6fea15683244f83a1d Mon Sep 17 00:00:00 2001 From: binarycat Date: Mon, 14 Sep 2026 15:33:13 -0400 Subject: [PATCH 08/11] rustdoc: Revert "fix bare urls split text" This reverts commit d4e6b8f2460d08f8028c71e5383a6300eaec1a9f. Reverted commit contains incorrect comments, does not implement all the functionality it claims to, and lacks test coverage. --- src/librustdoc/passes/lint/bare_urls.rs | 27 ++++++++++--------------- tests/rustdoc-ui/lints/bare-urls.fixed | 4 ---- tests/rustdoc-ui/lints/bare-urls.rs | 4 ---- tests/rustdoc-ui/lints/bare-urls.stderr | 14 +------------ 4 files changed, 12 insertions(+), 37 deletions(-) diff --git a/src/librustdoc/passes/lint/bare_urls.rs b/src/librustdoc/passes/lint/bare_urls.rs index 287a1f50b5aa1..0928980e390a8 100644 --- a/src/librustdoc/passes/lint/bare_urls.rs +++ b/src/librustdoc/passes/lint/bare_urls.rs @@ -2,14 +2,13 @@ //! Suggests wrapping the link with angle brackets: `Go to .` to linkify it. use core::ops::Range; +use std::mem; use std::sync::LazyLock; use regex::Regex; use rustc_errors::{Applicability, DiagDecorator}; use rustc_hir::HirId; -use rustc_resolve::rustdoc::pulldown_cmark::{ - DefaultBrokenLinkCallback, Event, Tag, TextMergeWithOffset, -}; +use rustc_resolve::rustdoc::pulldown_cmark::{Event, Parser, Tag}; use rustc_resolve::rustdoc::source_span_for_markdown_range; use tracing::trace; @@ -56,20 +55,21 @@ pub(super) fn visit_item(cx: &DocContext<'_>, item: &Item, hir_id: HirId, dox: & ); }; - // pulldown-cmark can split a URL into multiple `Text` events while processing - // characters such as `_` according to CommonMark's emphasis rules. - // `TextMergeWithOffset` merges these events so we can check the complete URL. - let mut p = TextMergeWithOffset::::new_ext(dox, main_body_opts()); + let mut p = Parser::new_ext(dox, main_body_opts()).into_offset_iter(); while let Some((event, range)) = p.next() { match event { Event::Text(s) => find_raw_urls(cx, dox, &s, range, &report_diag), // We don't want to check the text inside code blocks or links. Event::Start(tag @ (Tag::CodeBlock(_) | Tag::Link { .. })) => { - let end = tag.to_end(); for (event, _) in p.by_ref() { - if matches!(event, Event::End(tag) if tag == end) { - break; + match event { + Event::End(end) + if mem::discriminant(&end) == mem::discriminant(&tag.to_end()) => + { + break; + } + _ => {} } } } @@ -83,12 +83,7 @@ static URL_REGEX: LazyLock = LazyLock::new(|| { r"https?://", // url scheme r"([-a-zA-Z0-9@:%._\+~#=]{2,256}\.)+", // one or more subdomains r"[a-zA-Z]{2,63}", // root domain - // Match URL characters and balanced parenthesized segments, without - // consuming a trailing `)` that belongs to the surrounding prose. - r"\b(?:", - r"[-a-zA-Z0-9@:%_\+.~#?&/=]", - r"|\([-a-zA-Z0-9@:%_\+.~#?&/=]*\)", - r")*", + r"\b([-a-zA-Z0-9@:%_\+.~#?&/=]*)", // optional query or url fragments )) .expect("failed to build regex") }); diff --git a/tests/rustdoc-ui/lints/bare-urls.fixed b/tests/rustdoc-ui/lints/bare-urls.fixed index b18aae11c77cf..996214b5ff14f 100644 --- a/tests/rustdoc-ui/lints/bare-urls.fixed +++ b/tests/rustdoc-ui/lints/bare-urls.fixed @@ -92,7 +92,3 @@ pub fn trailing_period() {} /// ] //~^ ERROR this URL is not a hyperlink pub fn lint_with_brackets() {} - -/// See -//~^ ERROR this URL is not a hyperlink -pub fn hippo() {} diff --git a/tests/rustdoc-ui/lints/bare-urls.rs b/tests/rustdoc-ui/lints/bare-urls.rs index fb39ec6b6ccbd..9b4fe68e00322 100644 --- a/tests/rustdoc-ui/lints/bare-urls.rs +++ b/tests/rustdoc-ui/lints/bare-urls.rs @@ -92,7 +92,3 @@ pub fn trailing_period() {} /// https://bloob.blob] //~^ ERROR this URL is not a hyperlink pub fn lint_with_brackets() {} - -/// See https://en.wikipedia.org/wiki/Rust_(programming_language) -//~^ ERROR this URL is not a hyperlink -pub fn hippo() {} diff --git a/tests/rustdoc-ui/lints/bare-urls.stderr b/tests/rustdoc-ui/lints/bare-urls.stderr index a3a291e8e4bca..05ddd2ed42ab1 100644 --- a/tests/rustdoc-ui/lints/bare-urls.stderr +++ b/tests/rustdoc-ui/lints/bare-urls.stderr @@ -364,17 +364,5 @@ help: use an automatic link instead LL | /// ] | + + -error: this URL is not a hyperlink - --> $DIR/bare-urls.rs:96:9 - | -LL | /// See https://en.wikipedia.org/wiki/Rust_(programming_language) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: bare URLs are not automatically turned into clickable links -help: use an automatic link instead - | -LL | /// See - | + + - -error: aborting due to 31 previous errors +error: aborting due to 30 previous errors From 6c291770a41d2e7b021042b2401216606fe669e8 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 6 Sep 2026 14:47:51 +0200 Subject: [PATCH 09/11] Clean up `test/rustdoc-html` folder by moving tests where appropriate --- tests/rustdoc-html/{ => codeblock}/bad-codeblock-syntax.rs | 0 tests/rustdoc-html/{ => codeblock}/codeblock-title.rs | 0 tests/rustdoc-html/{ => codeblock}/custom_code_classes.rs | 0 .../doctest-escape-boring-41783.codeblock.html | 0 .../{doctest => codeblock}/doctest-escape-boring-41783.rs | 0 tests/rustdoc-html/{doctest => codeblock}/editions.rs | 0 tests/rustdoc-html/{ => codeblock}/hidden-line.rs | 0 tests/rustdoc-html/{doctest => codeblock}/ignore-sometimes.rs | 0 tests/rustdoc-html/{ => codeblock}/playground-arg.rs | 0 tests/rustdoc-html/{ => codeblock}/playground-empty.rs | 0 tests/rustdoc-html/{ => codeblock}/playground-none.rs | 0 tests/rustdoc-html/{ => codeblock}/playground-syntax-error.rs | 0 tests/rustdoc-html/{ => codeblock}/playground.rs | 0 tests/rustdoc-html/{ => codeblock}/short-docblock-codeblock.rs | 0 tests/rustdoc-html/{ => codeblock}/summary-codeblock-31899.rs | 0 tests/rustdoc-html/{ => codeblock}/unindent.md | 0 tests/rustdoc-html/{ => codeblock}/unindent.rs | 0 .../footnote-definition-without-blank-line-100638.rs | 0 tests/rustdoc-html/{ => footnote}/footnote-ids.rs | 0 tests/rustdoc-html/{ => footnote}/footnote-in-summary.rs | 0 tests/rustdoc-html/{ => footnote}/footnote-reference-ids.rs | 0 .../{ => footnote}/footnote-reference-in-footnote-def.rs | 0 tests/rustdoc-html/{ => hidden}/display-hidden-items.rs | 0 tests/rustdoc-html/{ => hidden}/document-hidden-items-15347.rs | 0 .../hidden-trait-methods-with-document-hidden-items.rs | 0 tests/rustdoc-html/{ => macro}/auxiliary/generated_macro.rs | 0 tests/rustdoc-html/{ => macro}/generated_macro.rs | 0 .../{ => reexport}/auxiliary/inline-default-methods.rs | 0 tests/rustdoc-html/{ => reexport}/auxiliary/issue-61592.rs | 0 tests/rustdoc-html/{ => reexport}/infinite-redirection.rs | 0 tests/rustdoc-html/{ => reexport}/inline-default-methods.rs | 0 tests/rustdoc-html/{ => reexport}/inline-rename-34473.rs | 0 tests/rustdoc-html/{ => reexport}/macro-reexport-inline.rs | 0 tests/rustdoc-html/{ => reexport}/pub-use-loop-107350.rs | 0 tests/rustdoc-html/{ => reexport}/pub-use-root-path-95873.rs | 0 tests/rustdoc-html/{ => reexport}/underscore-import-61592.rs | 0 tests/rustdoc-html/{ => reexport}/use-attr.rs | 0 .../{ => type-alias}/auxiliary/cross_crate_generic_typedef.rs | 0 .../{ => type-alias}/typedef-inner-variants-document-hidden.rs | 0 .../{ => type-alias}/typedef-inner-variants-lazy_type_alias.rs | 0 tests/rustdoc-html/{ => type-alias}/typedef-inner-variants.rs | 0 tests/rustdoc-html/{ => type-alias}/typedef.rs | 0 tests/rustdoc-html/{ => union}/union-fields-html.rs | 0 tests/rustdoc-html/{ => union}/union.rs | 0 44 files changed, 0 insertions(+), 0 deletions(-) rename tests/rustdoc-html/{ => codeblock}/bad-codeblock-syntax.rs (100%) rename tests/rustdoc-html/{ => codeblock}/codeblock-title.rs (100%) rename tests/rustdoc-html/{ => codeblock}/custom_code_classes.rs (100%) rename tests/rustdoc-html/{doctest => codeblock}/doctest-escape-boring-41783.codeblock.html (100%) rename tests/rustdoc-html/{doctest => codeblock}/doctest-escape-boring-41783.rs (100%) rename tests/rustdoc-html/{doctest => codeblock}/editions.rs (100%) rename tests/rustdoc-html/{ => codeblock}/hidden-line.rs (100%) rename tests/rustdoc-html/{doctest => codeblock}/ignore-sometimes.rs (100%) rename tests/rustdoc-html/{ => codeblock}/playground-arg.rs (100%) rename tests/rustdoc-html/{ => codeblock}/playground-empty.rs (100%) rename tests/rustdoc-html/{ => codeblock}/playground-none.rs (100%) rename tests/rustdoc-html/{ => codeblock}/playground-syntax-error.rs (100%) rename tests/rustdoc-html/{ => codeblock}/playground.rs (100%) rename tests/rustdoc-html/{ => codeblock}/short-docblock-codeblock.rs (100%) rename tests/rustdoc-html/{ => codeblock}/summary-codeblock-31899.rs (100%) rename tests/rustdoc-html/{ => codeblock}/unindent.md (100%) rename tests/rustdoc-html/{ => codeblock}/unindent.rs (100%) rename tests/rustdoc-html/{ => footnote}/footnote-definition-without-blank-line-100638.rs (100%) rename tests/rustdoc-html/{ => footnote}/footnote-ids.rs (100%) rename tests/rustdoc-html/{ => footnote}/footnote-in-summary.rs (100%) rename tests/rustdoc-html/{ => footnote}/footnote-reference-ids.rs (100%) rename tests/rustdoc-html/{ => footnote}/footnote-reference-in-footnote-def.rs (100%) rename tests/rustdoc-html/{ => hidden}/display-hidden-items.rs (100%) rename tests/rustdoc-html/{ => hidden}/document-hidden-items-15347.rs (100%) rename tests/rustdoc-html/{ => hidden}/hidden-trait-methods-with-document-hidden-items.rs (100%) rename tests/rustdoc-html/{ => macro}/auxiliary/generated_macro.rs (100%) rename tests/rustdoc-html/{ => macro}/generated_macro.rs (100%) rename tests/rustdoc-html/{ => reexport}/auxiliary/inline-default-methods.rs (100%) rename tests/rustdoc-html/{ => reexport}/auxiliary/issue-61592.rs (100%) rename tests/rustdoc-html/{ => reexport}/infinite-redirection.rs (100%) rename tests/rustdoc-html/{ => reexport}/inline-default-methods.rs (100%) rename tests/rustdoc-html/{ => reexport}/inline-rename-34473.rs (100%) rename tests/rustdoc-html/{ => reexport}/macro-reexport-inline.rs (100%) rename tests/rustdoc-html/{ => reexport}/pub-use-loop-107350.rs (100%) rename tests/rustdoc-html/{ => reexport}/pub-use-root-path-95873.rs (100%) rename tests/rustdoc-html/{ => reexport}/underscore-import-61592.rs (100%) rename tests/rustdoc-html/{ => reexport}/use-attr.rs (100%) rename tests/rustdoc-html/{ => type-alias}/auxiliary/cross_crate_generic_typedef.rs (100%) rename tests/rustdoc-html/{ => type-alias}/typedef-inner-variants-document-hidden.rs (100%) rename tests/rustdoc-html/{ => type-alias}/typedef-inner-variants-lazy_type_alias.rs (100%) rename tests/rustdoc-html/{ => type-alias}/typedef-inner-variants.rs (100%) rename tests/rustdoc-html/{ => type-alias}/typedef.rs (100%) rename tests/rustdoc-html/{ => union}/union-fields-html.rs (100%) rename tests/rustdoc-html/{ => union}/union.rs (100%) diff --git a/tests/rustdoc-html/bad-codeblock-syntax.rs b/tests/rustdoc-html/codeblock/bad-codeblock-syntax.rs similarity index 100% rename from tests/rustdoc-html/bad-codeblock-syntax.rs rename to tests/rustdoc-html/codeblock/bad-codeblock-syntax.rs diff --git a/tests/rustdoc-html/codeblock-title.rs b/tests/rustdoc-html/codeblock/codeblock-title.rs similarity index 100% rename from tests/rustdoc-html/codeblock-title.rs rename to tests/rustdoc-html/codeblock/codeblock-title.rs diff --git a/tests/rustdoc-html/custom_code_classes.rs b/tests/rustdoc-html/codeblock/custom_code_classes.rs similarity index 100% rename from tests/rustdoc-html/custom_code_classes.rs rename to tests/rustdoc-html/codeblock/custom_code_classes.rs diff --git a/tests/rustdoc-html/doctest/doctest-escape-boring-41783.codeblock.html b/tests/rustdoc-html/codeblock/doctest-escape-boring-41783.codeblock.html similarity index 100% rename from tests/rustdoc-html/doctest/doctest-escape-boring-41783.codeblock.html rename to tests/rustdoc-html/codeblock/doctest-escape-boring-41783.codeblock.html diff --git a/tests/rustdoc-html/doctest/doctest-escape-boring-41783.rs b/tests/rustdoc-html/codeblock/doctest-escape-boring-41783.rs similarity index 100% rename from tests/rustdoc-html/doctest/doctest-escape-boring-41783.rs rename to tests/rustdoc-html/codeblock/doctest-escape-boring-41783.rs diff --git a/tests/rustdoc-html/doctest/editions.rs b/tests/rustdoc-html/codeblock/editions.rs similarity index 100% rename from tests/rustdoc-html/doctest/editions.rs rename to tests/rustdoc-html/codeblock/editions.rs diff --git a/tests/rustdoc-html/hidden-line.rs b/tests/rustdoc-html/codeblock/hidden-line.rs similarity index 100% rename from tests/rustdoc-html/hidden-line.rs rename to tests/rustdoc-html/codeblock/hidden-line.rs diff --git a/tests/rustdoc-html/doctest/ignore-sometimes.rs b/tests/rustdoc-html/codeblock/ignore-sometimes.rs similarity index 100% rename from tests/rustdoc-html/doctest/ignore-sometimes.rs rename to tests/rustdoc-html/codeblock/ignore-sometimes.rs diff --git a/tests/rustdoc-html/playground-arg.rs b/tests/rustdoc-html/codeblock/playground-arg.rs similarity index 100% rename from tests/rustdoc-html/playground-arg.rs rename to tests/rustdoc-html/codeblock/playground-arg.rs diff --git a/tests/rustdoc-html/playground-empty.rs b/tests/rustdoc-html/codeblock/playground-empty.rs similarity index 100% rename from tests/rustdoc-html/playground-empty.rs rename to tests/rustdoc-html/codeblock/playground-empty.rs diff --git a/tests/rustdoc-html/playground-none.rs b/tests/rustdoc-html/codeblock/playground-none.rs similarity index 100% rename from tests/rustdoc-html/playground-none.rs rename to tests/rustdoc-html/codeblock/playground-none.rs diff --git a/tests/rustdoc-html/playground-syntax-error.rs b/tests/rustdoc-html/codeblock/playground-syntax-error.rs similarity index 100% rename from tests/rustdoc-html/playground-syntax-error.rs rename to tests/rustdoc-html/codeblock/playground-syntax-error.rs diff --git a/tests/rustdoc-html/playground.rs b/tests/rustdoc-html/codeblock/playground.rs similarity index 100% rename from tests/rustdoc-html/playground.rs rename to tests/rustdoc-html/codeblock/playground.rs diff --git a/tests/rustdoc-html/short-docblock-codeblock.rs b/tests/rustdoc-html/codeblock/short-docblock-codeblock.rs similarity index 100% rename from tests/rustdoc-html/short-docblock-codeblock.rs rename to tests/rustdoc-html/codeblock/short-docblock-codeblock.rs diff --git a/tests/rustdoc-html/summary-codeblock-31899.rs b/tests/rustdoc-html/codeblock/summary-codeblock-31899.rs similarity index 100% rename from tests/rustdoc-html/summary-codeblock-31899.rs rename to tests/rustdoc-html/codeblock/summary-codeblock-31899.rs diff --git a/tests/rustdoc-html/unindent.md b/tests/rustdoc-html/codeblock/unindent.md similarity index 100% rename from tests/rustdoc-html/unindent.md rename to tests/rustdoc-html/codeblock/unindent.md diff --git a/tests/rustdoc-html/unindent.rs b/tests/rustdoc-html/codeblock/unindent.rs similarity index 100% rename from tests/rustdoc-html/unindent.rs rename to tests/rustdoc-html/codeblock/unindent.rs diff --git a/tests/rustdoc-html/footnote-definition-without-blank-line-100638.rs b/tests/rustdoc-html/footnote/footnote-definition-without-blank-line-100638.rs similarity index 100% rename from tests/rustdoc-html/footnote-definition-without-blank-line-100638.rs rename to tests/rustdoc-html/footnote/footnote-definition-without-blank-line-100638.rs diff --git a/tests/rustdoc-html/footnote-ids.rs b/tests/rustdoc-html/footnote/footnote-ids.rs similarity index 100% rename from tests/rustdoc-html/footnote-ids.rs rename to tests/rustdoc-html/footnote/footnote-ids.rs diff --git a/tests/rustdoc-html/footnote-in-summary.rs b/tests/rustdoc-html/footnote/footnote-in-summary.rs similarity index 100% rename from tests/rustdoc-html/footnote-in-summary.rs rename to tests/rustdoc-html/footnote/footnote-in-summary.rs diff --git a/tests/rustdoc-html/footnote-reference-ids.rs b/tests/rustdoc-html/footnote/footnote-reference-ids.rs similarity index 100% rename from tests/rustdoc-html/footnote-reference-ids.rs rename to tests/rustdoc-html/footnote/footnote-reference-ids.rs diff --git a/tests/rustdoc-html/footnote-reference-in-footnote-def.rs b/tests/rustdoc-html/footnote/footnote-reference-in-footnote-def.rs similarity index 100% rename from tests/rustdoc-html/footnote-reference-in-footnote-def.rs rename to tests/rustdoc-html/footnote/footnote-reference-in-footnote-def.rs diff --git a/tests/rustdoc-html/display-hidden-items.rs b/tests/rustdoc-html/hidden/display-hidden-items.rs similarity index 100% rename from tests/rustdoc-html/display-hidden-items.rs rename to tests/rustdoc-html/hidden/display-hidden-items.rs diff --git a/tests/rustdoc-html/document-hidden-items-15347.rs b/tests/rustdoc-html/hidden/document-hidden-items-15347.rs similarity index 100% rename from tests/rustdoc-html/document-hidden-items-15347.rs rename to tests/rustdoc-html/hidden/document-hidden-items-15347.rs diff --git a/tests/rustdoc-html/hidden-trait-methods-with-document-hidden-items.rs b/tests/rustdoc-html/hidden/hidden-trait-methods-with-document-hidden-items.rs similarity index 100% rename from tests/rustdoc-html/hidden-trait-methods-with-document-hidden-items.rs rename to tests/rustdoc-html/hidden/hidden-trait-methods-with-document-hidden-items.rs diff --git a/tests/rustdoc-html/auxiliary/generated_macro.rs b/tests/rustdoc-html/macro/auxiliary/generated_macro.rs similarity index 100% rename from tests/rustdoc-html/auxiliary/generated_macro.rs rename to tests/rustdoc-html/macro/auxiliary/generated_macro.rs diff --git a/tests/rustdoc-html/generated_macro.rs b/tests/rustdoc-html/macro/generated_macro.rs similarity index 100% rename from tests/rustdoc-html/generated_macro.rs rename to tests/rustdoc-html/macro/generated_macro.rs diff --git a/tests/rustdoc-html/auxiliary/inline-default-methods.rs b/tests/rustdoc-html/reexport/auxiliary/inline-default-methods.rs similarity index 100% rename from tests/rustdoc-html/auxiliary/inline-default-methods.rs rename to tests/rustdoc-html/reexport/auxiliary/inline-default-methods.rs diff --git a/tests/rustdoc-html/auxiliary/issue-61592.rs b/tests/rustdoc-html/reexport/auxiliary/issue-61592.rs similarity index 100% rename from tests/rustdoc-html/auxiliary/issue-61592.rs rename to tests/rustdoc-html/reexport/auxiliary/issue-61592.rs diff --git a/tests/rustdoc-html/infinite-redirection.rs b/tests/rustdoc-html/reexport/infinite-redirection.rs similarity index 100% rename from tests/rustdoc-html/infinite-redirection.rs rename to tests/rustdoc-html/reexport/infinite-redirection.rs diff --git a/tests/rustdoc-html/inline-default-methods.rs b/tests/rustdoc-html/reexport/inline-default-methods.rs similarity index 100% rename from tests/rustdoc-html/inline-default-methods.rs rename to tests/rustdoc-html/reexport/inline-default-methods.rs diff --git a/tests/rustdoc-html/inline-rename-34473.rs b/tests/rustdoc-html/reexport/inline-rename-34473.rs similarity index 100% rename from tests/rustdoc-html/inline-rename-34473.rs rename to tests/rustdoc-html/reexport/inline-rename-34473.rs diff --git a/tests/rustdoc-html/macro-reexport-inline.rs b/tests/rustdoc-html/reexport/macro-reexport-inline.rs similarity index 100% rename from tests/rustdoc-html/macro-reexport-inline.rs rename to tests/rustdoc-html/reexport/macro-reexport-inline.rs diff --git a/tests/rustdoc-html/pub-use-loop-107350.rs b/tests/rustdoc-html/reexport/pub-use-loop-107350.rs similarity index 100% rename from tests/rustdoc-html/pub-use-loop-107350.rs rename to tests/rustdoc-html/reexport/pub-use-loop-107350.rs diff --git a/tests/rustdoc-html/pub-use-root-path-95873.rs b/tests/rustdoc-html/reexport/pub-use-root-path-95873.rs similarity index 100% rename from tests/rustdoc-html/pub-use-root-path-95873.rs rename to tests/rustdoc-html/reexport/pub-use-root-path-95873.rs diff --git a/tests/rustdoc-html/underscore-import-61592.rs b/tests/rustdoc-html/reexport/underscore-import-61592.rs similarity index 100% rename from tests/rustdoc-html/underscore-import-61592.rs rename to tests/rustdoc-html/reexport/underscore-import-61592.rs diff --git a/tests/rustdoc-html/use-attr.rs b/tests/rustdoc-html/reexport/use-attr.rs similarity index 100% rename from tests/rustdoc-html/use-attr.rs rename to tests/rustdoc-html/reexport/use-attr.rs diff --git a/tests/rustdoc-html/auxiliary/cross_crate_generic_typedef.rs b/tests/rustdoc-html/type-alias/auxiliary/cross_crate_generic_typedef.rs similarity index 100% rename from tests/rustdoc-html/auxiliary/cross_crate_generic_typedef.rs rename to tests/rustdoc-html/type-alias/auxiliary/cross_crate_generic_typedef.rs diff --git a/tests/rustdoc-html/typedef-inner-variants-document-hidden.rs b/tests/rustdoc-html/type-alias/typedef-inner-variants-document-hidden.rs similarity index 100% rename from tests/rustdoc-html/typedef-inner-variants-document-hidden.rs rename to tests/rustdoc-html/type-alias/typedef-inner-variants-document-hidden.rs diff --git a/tests/rustdoc-html/typedef-inner-variants-lazy_type_alias.rs b/tests/rustdoc-html/type-alias/typedef-inner-variants-lazy_type_alias.rs similarity index 100% rename from tests/rustdoc-html/typedef-inner-variants-lazy_type_alias.rs rename to tests/rustdoc-html/type-alias/typedef-inner-variants-lazy_type_alias.rs diff --git a/tests/rustdoc-html/typedef-inner-variants.rs b/tests/rustdoc-html/type-alias/typedef-inner-variants.rs similarity index 100% rename from tests/rustdoc-html/typedef-inner-variants.rs rename to tests/rustdoc-html/type-alias/typedef-inner-variants.rs diff --git a/tests/rustdoc-html/typedef.rs b/tests/rustdoc-html/type-alias/typedef.rs similarity index 100% rename from tests/rustdoc-html/typedef.rs rename to tests/rustdoc-html/type-alias/typedef.rs diff --git a/tests/rustdoc-html/union-fields-html.rs b/tests/rustdoc-html/union/union-fields-html.rs similarity index 100% rename from tests/rustdoc-html/union-fields-html.rs rename to tests/rustdoc-html/union/union-fields-html.rs diff --git a/tests/rustdoc-html/union.rs b/tests/rustdoc-html/union/union.rs similarity index 100% rename from tests/rustdoc-html/union.rs rename to tests/rustdoc-html/union/union.rs From 4e775637956cb098200acb56ffab80c78553faf1 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 14 Sep 2026 22:17:54 +0200 Subject: [PATCH 10/11] Rename `tests/rustdoc-html/type-alias` folder into `tests/rustdoc-html/typedef` --- .../auxiliary/cross_crate_generic_typedef.rs | 0 .../{type-alias => typedef}/auxiliary/parent-crate-115718.rs | 0 tests/rustdoc-html/{type-alias => typedef}/cross-crate-115718.rs | 0 tests/rustdoc-html/{type-alias => typedef}/deref-32077.rs | 0 .../{type-alias => typedef}/impl_trait_in_assoc_type.rs | 0 .../{type-alias => typedef}/primitive-local-link-121106.rs | 0 tests/rustdoc-html/{type-alias => typedef}/repr.rs | 0 tests/rustdoc-html/{type-alias => typedef}/same-crate-115718.rs | 0 .../typedef-inner-variants-document-hidden.rs | 0 .../typedef-inner-variants-lazy_type_alias.rs | 0 .../{type-alias => typedef}/typedef-inner-variants.rs | 0 tests/rustdoc-html/{type-alias => typedef}/typedef.rs | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename tests/rustdoc-html/{type-alias => typedef}/auxiliary/cross_crate_generic_typedef.rs (100%) rename tests/rustdoc-html/{type-alias => typedef}/auxiliary/parent-crate-115718.rs (100%) rename tests/rustdoc-html/{type-alias => typedef}/cross-crate-115718.rs (100%) rename tests/rustdoc-html/{type-alias => typedef}/deref-32077.rs (100%) rename tests/rustdoc-html/{type-alias => typedef}/impl_trait_in_assoc_type.rs (100%) rename tests/rustdoc-html/{type-alias => typedef}/primitive-local-link-121106.rs (100%) rename tests/rustdoc-html/{type-alias => typedef}/repr.rs (100%) rename tests/rustdoc-html/{type-alias => typedef}/same-crate-115718.rs (100%) rename tests/rustdoc-html/{type-alias => typedef}/typedef-inner-variants-document-hidden.rs (100%) rename tests/rustdoc-html/{type-alias => typedef}/typedef-inner-variants-lazy_type_alias.rs (100%) rename tests/rustdoc-html/{type-alias => typedef}/typedef-inner-variants.rs (100%) rename tests/rustdoc-html/{type-alias => typedef}/typedef.rs (100%) diff --git a/tests/rustdoc-html/type-alias/auxiliary/cross_crate_generic_typedef.rs b/tests/rustdoc-html/typedef/auxiliary/cross_crate_generic_typedef.rs similarity index 100% rename from tests/rustdoc-html/type-alias/auxiliary/cross_crate_generic_typedef.rs rename to tests/rustdoc-html/typedef/auxiliary/cross_crate_generic_typedef.rs diff --git a/tests/rustdoc-html/type-alias/auxiliary/parent-crate-115718.rs b/tests/rustdoc-html/typedef/auxiliary/parent-crate-115718.rs similarity index 100% rename from tests/rustdoc-html/type-alias/auxiliary/parent-crate-115718.rs rename to tests/rustdoc-html/typedef/auxiliary/parent-crate-115718.rs diff --git a/tests/rustdoc-html/type-alias/cross-crate-115718.rs b/tests/rustdoc-html/typedef/cross-crate-115718.rs similarity index 100% rename from tests/rustdoc-html/type-alias/cross-crate-115718.rs rename to tests/rustdoc-html/typedef/cross-crate-115718.rs diff --git a/tests/rustdoc-html/type-alias/deref-32077.rs b/tests/rustdoc-html/typedef/deref-32077.rs similarity index 100% rename from tests/rustdoc-html/type-alias/deref-32077.rs rename to tests/rustdoc-html/typedef/deref-32077.rs diff --git a/tests/rustdoc-html/type-alias/impl_trait_in_assoc_type.rs b/tests/rustdoc-html/typedef/impl_trait_in_assoc_type.rs similarity index 100% rename from tests/rustdoc-html/type-alias/impl_trait_in_assoc_type.rs rename to tests/rustdoc-html/typedef/impl_trait_in_assoc_type.rs diff --git a/tests/rustdoc-html/type-alias/primitive-local-link-121106.rs b/tests/rustdoc-html/typedef/primitive-local-link-121106.rs similarity index 100% rename from tests/rustdoc-html/type-alias/primitive-local-link-121106.rs rename to tests/rustdoc-html/typedef/primitive-local-link-121106.rs diff --git a/tests/rustdoc-html/type-alias/repr.rs b/tests/rustdoc-html/typedef/repr.rs similarity index 100% rename from tests/rustdoc-html/type-alias/repr.rs rename to tests/rustdoc-html/typedef/repr.rs diff --git a/tests/rustdoc-html/type-alias/same-crate-115718.rs b/tests/rustdoc-html/typedef/same-crate-115718.rs similarity index 100% rename from tests/rustdoc-html/type-alias/same-crate-115718.rs rename to tests/rustdoc-html/typedef/same-crate-115718.rs diff --git a/tests/rustdoc-html/type-alias/typedef-inner-variants-document-hidden.rs b/tests/rustdoc-html/typedef/typedef-inner-variants-document-hidden.rs similarity index 100% rename from tests/rustdoc-html/type-alias/typedef-inner-variants-document-hidden.rs rename to tests/rustdoc-html/typedef/typedef-inner-variants-document-hidden.rs diff --git a/tests/rustdoc-html/type-alias/typedef-inner-variants-lazy_type_alias.rs b/tests/rustdoc-html/typedef/typedef-inner-variants-lazy_type_alias.rs similarity index 100% rename from tests/rustdoc-html/type-alias/typedef-inner-variants-lazy_type_alias.rs rename to tests/rustdoc-html/typedef/typedef-inner-variants-lazy_type_alias.rs diff --git a/tests/rustdoc-html/type-alias/typedef-inner-variants.rs b/tests/rustdoc-html/typedef/typedef-inner-variants.rs similarity index 100% rename from tests/rustdoc-html/type-alias/typedef-inner-variants.rs rename to tests/rustdoc-html/typedef/typedef-inner-variants.rs diff --git a/tests/rustdoc-html/type-alias/typedef.rs b/tests/rustdoc-html/typedef/typedef.rs similarity index 100% rename from tests/rustdoc-html/type-alias/typedef.rs rename to tests/rustdoc-html/typedef/typedef.rs From 03e4c769ec9f936506cb12d9688e6a9535e936ad Mon Sep 17 00:00:00 2001 From: Ben Reeves Date: Mon, 14 Sep 2026 13:04:40 -0700 Subject: [PATCH 11/11] AGENTS.md: Permit local experimentation, per the online policy. As previously written, AGENTS.md prohibited my LLM from performing edits as part of a prototype that I never intended to upstream. This is explicitly permitted by the policy. Text drafted by Claude Fable 5.1 and edited by me. Change [pre-approved](https://rust-lang.zulipchat.com/#narrow/channel/606558-llm-reviews/topic/AGENTS.2Emd.20forbidding.20experimentation/near/624161741) by @jyn514 --- AGENTS.md | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index af1ad378bebdd..ce36bada00558 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,6 +21,25 @@ for the user to implement from scratch remain allowed if independently requested Alongside any text that could potentially be used as a substitute for prohibited text, include *in the same response turn* a reminder of the policies against text originally created by an LLM, even if given during a previous turn of the session. Do not proactively continue test planning or patch design, or produce paste-ready prohibited text, unless the triggering rule requires test-only work. +### Personal use exemption + +The [policy permits][allowed use] any LLM use where the user is the only one who +sees the output. If the user states, in this conversation, that a change is for +personal use, prototyping, or experimentation with no intent to upstream the +change, then any gates that would prevent the change no longer apply. +Do not infer this; a statement from the user is required. + +Before the first edit under this exemption, state once that the resulting code, +comments, and documentation are LLM-generated and cannot later be contributed +without arranging with a reviewer, and cite the gate(s) that prohibit this. + +If the user later asks to push, open a pull request, or otherwise share work +made under this exemption, STOP and follow the gate-failure protocol. +Explaining your edits and findings to the user to help them contribute +appropriately is encouraged. + +[allowed use]: https://forge.rust-lang.org/policies/llm-usage.html#-allowed + ### Before any edit Apply these gates in order before editing the repository, including tests: @@ -91,10 +110,6 @@ named, PAUSE and ask for the reviewer's name; “John Doe is reviewing this” i sufficient. A reviewer name satisfies only this gate. Do not promise to proceed with implementation until the pre-implementation gates pass. -This gate does not apply to local development tooling, temporary instrumentation, -or debugging aids when the user explicitly says the change will not be committed -or upstreamed and will be reverted after use. All other gates still apply. - ### Before implementation Apply these gates in order after the pre-edit gates: