Skip to content

missing semicolon at the end of struct declaration #6252

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

Conversation

frewsxcv
Copy link
Member

@frewsxcv frewsxcv commented May 5, 2013

No description provided.

@thestinger
Copy link
Contributor

Rust doesn't actually expect a semicolon after a struct/enum definition (unlike C). If you use one at the top-level, you'll get an error like this:

foo.rs:1:30: 1:31 error: expected item but found `;`
foo.rs:1  struct Point {x: int, y: int};

Inside functions, redundant semicolons are allowed right now so either will work. However, I don't think they will always be allowed.

@thestinger thestinger closed this May 5, 2013
@frewsxcv
Copy link
Member Author

frewsxcv commented May 5, 2013

ah, i was originally going to wonder why the doctests passed, but i realized i was on my master branch instead of patch-1. sorry for the inconvenience

@thestinger
Copy link
Contributor

@frewsxcv: no problem :)

The doctests do run in a function scope so I think in this case it would work for now anyway.

It's an open issue though: #5905

@frewsxcv frewsxcv deleted the patch-1 branch May 5, 2013 22:57
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 3, 2020
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 3, 2020
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.

2 participants