Skip to main content

phase_private_in_public

Function phase_private_in_public 

Source
pub fn phase_private_in_public(
    parsed: &[ParsedFile],
    groups: &BTreeMap<String, Vec<usize>>,
    errors: &mut ErrorSink,
)
Expand description

#2618 (decision C): a public declaration may not name a private type of its own unit in its signature, since a unit that uses it could neither name nor build a value of that type. Checked positions: a public fn’s parameter and return types (a method’s too, unless its type is itself private, when the method is out of an importer’s reach with it), a public type’s record fields and variant payloads, a public constant’s type annotation, and a context’s exports list. Each is bynk.visibility.private_in_public.

A service, agent, capability, provider, actor or event signature is not checked: how far those reach is a context’s exports question, and the cross-context structural rule (§6.5) is unchanged.