Skip to content

Conversation

@frewsxcv
Copy link
Contributor

@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
Contributor 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