From debb8af0ef0e72048b9df5fed40071745ea40c6b Mon Sep 17 00:00:00 2001 From: aur-build Date: Fri, 20 Nov 2026 23:39:07 +0000 Subject: sandbox,http,review,watch: keep six more test-only types out of the release build --- src/sandbox/mod.rs | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src/sandbox') diff --git a/src/sandbox/mod.rs b/src/sandbox/mod.rs index 6c90f7f..ded76f0 100644 --- a/src/sandbox/mod.rs +++ b/src/sandbox/mod.rs @@ -73,13 +73,30 @@ impl SandboxSpec { } } -#[derive(Debug, Clone)] -pub struct SandboxInfo { - pub id: String, - pub profile: String, - pub warm: bool, +/// The real definition. The module is private, so this `pub` +/// is not a nameable path from outside; the alias below is the +/// only way to reach it, and the alias is what carries the +/// feature-conditional visibility. +mod sandbox_info { + #[derive(Debug, Clone)] + pub struct SandboxInfo { + pub id: String, + pub profile: String, + pub warm: bool, + } } +/// The return type of `SandboxBackend::status`. No production module outside `sandbox` names it; the backend tests do. +/// +/// `pub` only under `test-support`. Production reaches the type +/// through its own module and never names it from outside; the +/// outside reader that needs the name is a test. +#[cfg(feature = "test-support")] +pub use sandbox_info::SandboxInfo; + +#[cfg(not(feature = "test-support"))] +pub(crate) use sandbox_info::SandboxInfo; + pub trait Sandbox: Send + Sync { fn id(&self) -> &str; fn run(&self, cmd: &Cmd, on_log: &mut dyn FnMut(&[u8])) -> Result; -- cgit v1.2.3