pub struct Def<'a> {
pub id: DefinitionId,
pub file: FileId,
pub params: &'a [Param],
pub body: &'a Block,
pub return_annotation: Option<&'a TypeExpr>,
pub native: bool,
}Expand description
One inferable definition: its own id, declaring file, declared params, and body.
pub (FG-2.1, issue #638): brink-db’s solve_scc_query builds these
itself from per-def def_body_query results (Ruling 2b’s narrowed HIR
projection) and passes them into solve_scc directly, instead of
solve_scc rebuilding them via [collect_defs] over a whole-project
(or even whole-file) HIR slice.
Fields§
§id: DefinitionId§file: FileId§params: &'a [Param]§body: &'a Block§return_annotation: Option<&'a TypeExpr>The function-header return annotation (): type ===), when the def
is a knot that carries one (T1c — the boundary-annotation firewall
applied to the return slot: an Unknown inferred return overlays to
the annotated type, so #fn rows built from this signature are
concrete). None for stitches and unannotated knots.
native: boolWhich frontend produced Self::file — HirFile::native (issue
#1862), carried per def because that is the granularity every
consumer of this struct has: brink-db’s narrowed per-def HIR
projection never holds a whole HirFile. Reaches inference as
[body::BodyCtx::native], where the native bare-name fn-value rule
(issue #1876) keys off it.