Skip to content

Allow trailing comma in concat! #15118

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

Closed
wants to merge 1 commit into from
Closed

Conversation

stepancheg
Copy link
Contributor

(And in other extensions implemented with get_exprs_from_tts function).

(And in other extensions implemented with `get_exprs_from_tts` function).
// allow trailing comma
if p.token != token::EOF {
es.push(cx.expand_expr(p.parse_expr()));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loop should probably be restructured to look something like:

while p.token != token::EOF {
    es.push(cx.expand_expr(p.parse_expr()));
    if p.eat(&token::COMMA) { continue }
    if p.token != token::EOF { /* error about trailing expressions */ }
}

In general I don't think that the error expected token: "," should show up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexcrichton expected token: "," message looks correct to me. Can be suggest a better message?

@stepancheg
Copy link
Contributor Author

Updated patch as suggested by @alexcrichton.

bors added a commit that referenced this pull request Jun 24, 2014
(And in other extensions implemented with `get_exprs_from_tts` function).
@bors bors closed this Jun 24, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 17, 2023
…, r=Veykril

Follow raw pointers in autoderef chain when resolving methods with custom receiver

Fixes rust-lang#15083

I believe this stopped working after alexkirsz/rust-analyzer@e797479
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants