-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Allow #[auto_enum] to be directly used on if expressions #86
Comments
This is no longer blocked. |
I've been using auto_enums on Btw, any idea why rustc complains about "unnecessary braces around function argument" after I updated my nightly? rust-lang/rust#71080 |
Yes, basically I want to annotate Practically the same as the current one, it would be nice to support the following styles: #[auto_enum]
fn a() {
let res = {
// This is the same as using #[auto_enum] on `let`,
// but maybe easier to read depending on the length of the block.
#[auto_enum]
if x {
// ...
} else {
// ...
}
};
}
#[auto_enum]
fn b() -> Option<impl Foo> {
// Equivalent to `#[auto_enum] let res = if ...` and `Some(res)`
Some(#[auto_enum] if x { y } else { x })
} And, these are already available on |
Thanks for reporting it, I will look into it. |
Oh..., this comment is not correct. The second example does not work without unstable features even if I replace |
Once rust-lang/rust#68618 is resolved, we can support this.
The text was updated successfully, but these errors were encountered: