Skip to main content

check_protocol_impls

Function check_protocol_impls 

Source
pub fn check_protocol_impls(
    files: &[(FileId, &HirFile)],
    index: &SymbolIndex,
    resolutions: &ResolutionMap,
    host_manifest: Option<&HostManifest>,
    impls: &[ProtocolImplDecl],
) -> Vec<Diagnostic>
Expand description

Validate registered protocol impls: shape against the protocol’s signature (E115) and inferred effect row against the protocol’s contract (E114). Returns all diagnostics; an impl that fails a shape check is not row-checked (the E102-before-E103 posture — don’t stack a second diagnostic on an impl that can’t even be resolved).

Effect rows are computed via crate::infer::effects_project only when at least one impl passes shape validation — an impl-free project (today: every project) never pays for effect inference here.

Diagnostics carry the impl function’s declaration range where resolvable, else the file-start range of the first file (registration is not a source construct yet, so there is no registration site to point at).