-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept a closure for with
in lieu of a path for fields
#310
Conversation
61a4447
to
5ecff50
Compare
If you'd like to avoid using a local variable there are two ways to do that: The naive way is to just cast the expression with Another way to do that is with I think there doesn't have to be any special case for closure/non-closure expressions. If you pass a function path to the |
5ecff50
to
8234b61
Compare
Using |
@Veetaha I've updated this using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM, except docs should need a small update
@Veetaha ugh, one more question for you: Any ideas on how to fix the output of the compiletest so it will pass both locally and on CI? It seems the issue is the path on the last line of the error, potentially due to the use of |
I haven't used The version of trybuild, that supports 1.56 MSRV is Try adding this test, maybe it'll work: #[test]
fn ui() {
let t = trybuild::TestCases::new();
t.compile_fail("tests/compile-fail/*.rs");
} |
I'm using It appears that locally updating |
Okay, it looks like |
Do you mean this error?:
If yes, then that's expected because this happens not at the building stage, but when updating the crates.io index. Although, I must admit, I don't understand why |
Yes, that's the error I meant. Thanks for the explanation. For now, it seems that leaving the dependency at 1.0.89 is sufficient. If it ever breaks, that'll probably be a sign it's time to bump I've updated examples, tests, and CHANGELOG for this feature; I didn't see any places in the actual docs where a change was needed. I do want to look at expanding this to cover the other |
with
in lieu of a path for fieldswith
in lieu of a path for fields
Fixes #309
This has some issues, so it's not yet ready to merge:
with
is used.