From 4dc06fecaac16b478d6ca82b696172a538a4265b Mon Sep 17 00:00:00 2001 From: Daniel Eades Date: Sun, 12 Jul 2026 07:11:11 +0100 Subject: [PATCH] Restrict TypeSpace::break_cycles to crate visibility break_cycles is an internal helper that operates on raw ranges of internal type IDs. It was unintentionally exposed as public API: inherent-impl method visibility ignores module privacy, so `pub` in the private cycles module made it visible to external callers. It cannot be used meaningfully outside the crate, and calling it with arbitrary ranges could corrupt the type space. All call sites are internal, so mark it pub(crate). --- typify-impl/src/cycles.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typify-impl/src/cycles.rs b/typify-impl/src/cycles.rs index bda7b34a..0ebc6f76 100644 --- a/typify-impl/src/cycles.rs +++ b/typify-impl/src/cycles.rs @@ -17,7 +17,7 @@ impl TypeSpace { /// We need to root out any containment cycles, breaking them by inserting /// a `Box` type. Our choice of *where* to break cycles is more arbitrary /// than optimal, but is well beyond sufficient. - pub fn break_cycles(&mut self, range: Range) { + pub(crate) fn break_cycles(&mut self, range: Range) { enum Node { Start { type_id: TypeId,