-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Fix parsing for casting an empty return expression #39303
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Hm, I think you need to
The list should look like this if I'm not missing anything:
|
I agree. However, I didn't get a response when I asked about the more
general solution in the issue, so I decided to keep the scope small to
start (just `as`). If a more general (i.e. "correct") solution is wanted,
I'd be happy to do that instead.
…On Jan 25, 2017 2:18 PM, "Vadim Petrochenkov" ***@***.***> wrote:
Hm, I think you need to
- add the same condition to NtIdent below
- actually list all possible ident that can start an expression.
The list should look like this if I'm not missing anything:
- all !is_any_keyword idents
- is_path_segment_keyword idents
- box, break, continue, false, for, if, loop, match, move, return, true,
unsafe, while
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#39303 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFr9KRzjtZbpiJ5cqQRypcYzcCTeEXWBks5rV8ocgaJpZM4LuCZH>
.
|
@petrochenkov Great! I'll make that change then. |
@petrochenkov Just started working on this, and I wanted to clarify the desired behavior for the |
@cramertj |
@petrochenkov fn ident_can_begin_expr(ident: ast::Ident) -> bool {
let ident_token: Token = Ident(ident);
!ident_token.is_any_keyword() ||
ident_token.is_path_segment_keyword() ||
[
keywords::Box.name(),
keywords::Break.name(),
keywords::Continue.name(),
keywords::False.name(),
keywords::For.name(),
keywords::If.name(),
keywords::Loop.name(),
keywords::Match.name(),
keywords::Move.name(),
keywords::Return.name(),
keywords::True.name(),
keywords::Unsafe.name(),
keywords::While.name(),
].contains(&ident.name)
} |
I don't think |
They are expressions, they are just always result in |
Huh. TIL. |
Partial fix for #28784.