Add component attribute macro - #117
Open
robpatterson13 wants to merge 1 commit into
Open
robpatterson13 wants to merge 1 commit into
robpatterson13 wants to merge 1 commit into
Conversation
robpatterson13
added this pull request to stack #116
September 23, 2026 19:30
robpatterson13
force-pushed
the
rob/component-attr-macro
branch
from
September 23, 2026 19:35
bf31f46 to
36097ff
Compare
Contributor
|
…on sets of instructions from dialects
robpatterson13
force-pushed
the
rob/component-attr-macro
branch
from
September 23, 2026 19:36
36097ff to
d0cefd2
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a feature gated
#[component]attribute (currently behind thecomponent-attributefeature) for declaring which dialect instructions a struct handles. The#[instructions { ... }]list accepts named instructions, groups, and entire dialects, while keeping the struct and its existing fields intact.The macro implements Component and checks that the struct has an
Executeimplementation for every selected instruction. It supports generic structs, dialect aliases, and qualified paths. With the feature enabled,Componentno longer impliesHasInstructionSet, so callers that need generated instruction types must add that bound explicitly.The branch adds validation for duplicate or overlapping selections, unknown instructions, and missing
Executeimplementations, plus runtime and compile-fail tests.This adds the initial addition of this macro, but we might need additions in the (near) future to allow for instructions from a component to be pulled into a composite that contains it (as part of the instruction flattening implementation). Additionally, once this is stabilized, we can remove the feature flag and the
component!macro.