mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 02:32:42 +00:00
The `RequireDecl` instruction points, via a `RequireImplsId` to a `RequireImpls` structure in a `ValueStore`. That structure holds the self-type and facet type, as well as the generic id and parent scope. `RequireImpls` is always a generic since it only appears in an `interface` or `constraint`, which both have a generic parameter `Self` applied to all their members. The `RequireDecl` instruction evaluates to itself, but drops the decl_block_id since the instructions within the `require` declaration are not required in the canonical value which is only used for import. And import will want to import the `RequireImpls` structure along with the `Interface` or `NamedConstraint` structure it is in, rather than recreate it from the decl's instructions. This also avoids repeating all the instructions within the `require` decl in the textual semir's constants block. Adding the `RequireImpls` to the `Interface` or `NamedConstraint` structure is not yet done, so they are not available for impl lookup or import yet.