Remove type_check from Property trait#74
Merged
apoelstra merged 1 commit intoElementsProject:masterfrom Mar 2, 2024
Merged
Conversation
type_check from Property trait
65b55f7 to
f2d6835
Compare
Member
|
concept ACK based on your description. But the CI failures are real; the fuzztests need to be updated. |
The blanket implementation of `type_check` is only used on `CompilerExtData` while `ExtData` and `Type` override the impl and don't need the `child` parameter. Moreover, the fn isn't called as Property generic. So the blanket implementation of `type_check` is moved as a impl in `CompilerExtData` and the overrides in `ExtData` and `Type` are moved as simple impl on the type, making it possible to remove the unused `child` parameter.
f2d6835 to
500b4a5
Compare
Collaborator
Author
The issue was that I removed the the error with the closure was: The compiler error is fixed but I still don't grasp what's going on :S |
Collaborator
Author
|
Ci is fixed, does this need something? |
apoelstra
approved these changes
Mar 2, 2024
apoelstra
added a commit
to rust-bitcoin/rust-miniscript
that referenced
this pull request
Mar 4, 2024
5f41cb6 change FnMut -> Fn (Riccardo Casatta) cdcd53e Refactor out type_check (Riccardo Casatta) Pull request description: This apply the same logic of ElementsProject/elements-miniscript#74 removing a couple of unreachable, simplify things and very likely reduce binary bloat. ~~However, in doing so, I don't think this MR is equivalent to master for the logic used for `get_child`.~~ ~~I suspect current master is broken and this fix it (or viceversa?), but I have to suspend this work for now.~~ ACKs for top commit: apoelstra: ACK 5f41cb6 this is great, thanks! Tree-SHA512: 4b904fde55ba75895d377babde5e7a3a215cdf3b0ccff0c90572bb286de9d8a80234fc6a4921ad83bcb8c947affa1e3c23b2135534cb4363f38f1bab89368ba4
heap-coder
added a commit
to heap-coder/rust-miniscript
that referenced
this pull request
Sep 27, 2025
5f41cb64b5927dcd06b0c1ecda23ed27518b16d9 change FnMut -> Fn (Riccardo Casatta) cdcd53e36dc444d95291409b733604cde12faf9b Refactor out type_check (Riccardo Casatta) Pull request description: This apply the same logic of ElementsProject/elements-miniscript#74 removing a couple of unreachable, simplify things and very likely reduce binary bloat. ~~However, in doing so, I don't think this MR is equivalent to master for the logic used for `get_child`.~~ ~~I suspect current master is broken and this fix it (or viceversa?), but I have to suspend this work for now.~~ ACKs for top commit: apoelstra: ACK 5f41cb64b5927dcd06b0c1ecda23ed27518b16d9 this is great, thanks! Tree-SHA512: 4b904fde55ba75895d377babde5e7a3a215cdf3b0ccff0c90572bb286de9d8a80234fc6a4921ad83bcb8c947affa1e3c23b2135534cb4363f38f1bab89368ba4
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.
I was looking to port rust-bitcoin/rust-miniscript#584 here, but I realized we can probably do better (and maybe port this in rust-miniscript to simplify things)
The blanket implementation of
type_checkis only used onCompilerExtDatawhileExtDataandTypeoverride the impl and don't need thechildparameter. Moreover, the fn isn't called as Property generic.So the blanket implementation of
type_checkis moved as a impl inCompilerExtDataand the overrides inExtDataandTypeare moved as simple impl on the type, making it possible to remove the unusedchildparameter.