Compile anything which implements Source#1684
Merged
simoncozens merged 2 commits intomainfrom Oct 7, 2025
Merged
Conversation
cmyr
approved these changes
Oct 7, 2025
Member
cmyr
left a comment
There was a problem hiding this comment.
This looks good to me, modulo me not being sure the lifetimes are necessary :)
| } | ||
|
|
||
| impl Workload { | ||
| impl<'a> Workload<'a> { |
Member
There was a problem hiding this comment.
where does this lifetime parameter come from? More generally I don't think any of the lifetime additions in this patch are necessary? (if I just delete them all it still compiles)
6cda2cd to
a958f12
Compare
Contributor
Author
|
(I removed the lifetime business.) |
anthrotype
added a commit
that referenced
this pull request
Dec 4, 2025
…rce> support Refactor the compile arguments API to: - Rename `fontc::Args` to `fontc::Options` for clarity (avoids confusion with CLI `args::Args`) - Remove `input` field from Options - source is now passed separately - Update `generate_font()` to accept `Box<dyn Source>` + `Options` - Update `run()` to accept `Input` + `Options` This restores the ability to pass custom `Box<dyn Source>` implementations that was added in #1684, which library users need for generating their own IR programmatically. Also: - Add `Default` derive to `Options` for ergonomic in-memory/WASM usage - Rename `cli_args.rs` back to `args.rs` and delete `compile_args.rs` (Options inlined in lib.rs since it's short enough)
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.
Current, the input to the compiler API is
Input- which admittedly makes sense, given the name. But it means that inputs are restricted to the set of source types enumerated in theInputenum. If we have people implementing their own source types (which we do!) then it makes sense for allow compilation of any object whichimpl Source. This pushes the creation of aSourcefrom anInputhigher up the pipeline, so that anyBox<dyn Source>can be compiled.Also improves the lifetime story of
Workloadto avoid messing with'static-Workloads only need hang around as long as theSources that they are compiling.