Conversation
|
Actually it seems we also need to copy over attributes. I will need to work on this one still. |
|
Ok now it copies over attributes. This avoids duplicate types with code like: #[cfg(target_arch="wasm32")]
type Return;
#[cfg(not(target_arch="wasm32"))]
type Return: Send; |
411eee2 to
007db64
Compare
Codecov Report
@@ Coverage Diff @@
## master #6 +/- ##
==========================================
+ Coverage 78.18% 82.72% +4.53%
==========================================
Files 9 9
Lines 495 625 +130
==========================================
+ Hits 387 517 +130
Misses 108 108
Continue to review full report at Codecov.
|
007db64 to
650ea71
Compare
When adding blanket as a dependency to a blank cargo project, it fails to compile. This is due to missing features on the syn crate. This commit adds the needed features. This problem could not be detected from within the crate itself because features were leaking through from the dev-dependency of syn which does not have `default-features = false`. I turned on `resolver = "2"`. This is the new feature resolver for cargo that will become the default in edition 2021. This is not strictly necessary but it helps as it no longer leaks features. This means that `cargo check` will now fail if there are missing features. As `cargo test` obviously turns on the features from `dev-dependencies`, this will still not detect this issue. You might want to check your CI script and add a `cargo check` before running `cargo test`.
If not you can get duplicate type defs.
650ea71 to
46cb082
Compare
|
That was the last! I'll make a new release with all the changes you implemented. Thanks again! |
Awesome, glad it worked in the end. Will use in async_executors. We expose like 8 traits that are meant to be used as bounds, so blanket is a relief. ps: as some feedback, I think it would be possible to eliminate most of the redundancy, as derive is almost identical for all receivers. Either by factoring it out in functions of by generating it with a macro. It would make maintaining and updating the crate a lot less tedious I think. |
|
@najamelan : Wonderful! Don't hesitate to ping me if something breaks.
I agree, but I wanted to know where the code was going before building extra abstractions on top of it 😅 I'll see when I add the two last features I want to implementd (support for |
This implements the associated types of a trait on the blanket impls. Eg:
As before, this is rebased on top of the other PR's, #3, #4, #5. You might want to merge them first.