Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4d9a8b3
Add test that d32 is not available by default
adamgemmell Aug 11, 2026
454090a
Move armv7 targets to the generic LLVM target
adamgemmell Sep 3, 2026
c701054
Fix VFP levels docs for armv7a-none-eabi
adamgemmell Aug 11, 2026
55469d6
Remove the last -d32 from armv6 HF targets
adamgemmell Sep 4, 2026
4750ec7
Fix `*_trailing_sep` for Windows verbatim paths
ChrisDenton Sep 11, 2026
0f916bb
std: Make a lot of pub items crate private instead (ignore os/sys)
pacak Aug 23, 2026
56aed55
Respect do_not_recommend for a single impl candidate
kulinsky Sep 14, 2026
711a32b
rustdoc: Revert "fix bare urls split text"
lolbinarycat Sep 14, 2026
6c29177
Clean up `test/rustdoc-html` folder by moving tests where appropriate
GuillaumeGomez Sep 6, 2026
4e77563
Rename `tests/rustdoc-html/type-alias` folder into `tests/rustdoc-htm…
GuillaumeGomez Sep 14, 2026
03e4c76
AGENTS.md: Permit local experimentation, per the online policy.
BGR360 Sep 14, 2026
acf8543
Rollup merge of #160911 - adamgemmell:dev/adagem01/remove-d32, r=Amanieu
jhpratt Sep 15, 2026
326bc19
Rollup merge of #162771 - kulinsky:fix-do-not-recomend, r=estebank
jhpratt Sep 15, 2026
ffae6ee
Rollup merge of #162779 - lolbinarycat:rustdoc-revert-regex, r=Guilla…
jhpratt Sep 15, 2026
661db28
Rollup merge of #161612 - pacak:unreachable-pub, r=clarfonthey
jhpratt Sep 15, 2026
59fd981
Rollup merge of #162372 - GuillaumeGomez:cleanup-rustdoc-test, r=Urgau
jhpratt Sep 15, 2026
db6972d
Rollup merge of #162643 - ChrisDenton:trailing-sep-verbatim, r=Mark-S…
jhpratt Sep 15, 2026
7c2bb7c
Rollup merge of #162784 - Qumulo:agents-md-edit, r=jyn514
jhpratt Sep 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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()
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_target/src/spec/targets/armv7a_none_eabihf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/collections/hash/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Unordered containers, implemented as hash-tables

pub mod map;
pub mod set;
pub(crate) mod map;
pub(crate) mod set;
2 changes: 1 addition & 1 deletion library/std/src/fs/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/io/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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")]
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions library/std/src/panicking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -495,7 +495,7 @@ pub unsafe fn catch_unwind<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any +

/// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
#[cfg(not(panic = "immediate-abort"))]
pub unsafe fn catch_unwind<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>> {
pub(crate) unsafe fn catch_unwind<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>> {
union Data<F, R> {
f: ManuallyDrop<F>,
r: ManuallyDrop<R>,
Expand Down Expand Up @@ -599,14 +599,14 @@ pub unsafe fn catch_unwind<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any +

/// Determines whether the current thread is unwinding because of panic.
#[inline]
pub fn panicking() -> 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<String>,
Expand Down Expand Up @@ -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<dyn Any + Send>) -> ! {
pub(crate) fn resume_unwind(payload: Box<dyn Any + Send>) -> ! {
if let Some(must_abort) = panic_count::increase(false) {
match must_abort {
panic_count::MustAbort::PanicInHook => {
Expand Down
6 changes: 4 additions & 2 deletions library/std/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions library/std/src/process/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down
Loading
Loading