Skip to content

Usage of semicolon in traits definitions is inconsistent #5057

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
thomas001 opened this issue Feb 20, 2013 · 4 comments
Closed

Usage of semicolon in traits definitions is inconsistent #5057

thomas001 opened this issue Feb 20, 2013 · 4 comments
Labels
A-grammar Area: The grammar of Rust A-trait-system Area: Trait system

Comments

@thomas001
Copy link

In the definitions of struct and enum types the comma is used as separator between struct/enum members. In the definition of traits the semicolon is used instead. I think this syntax is inconsistent and should be changed to allow comma as separator for traits as well.

An intuitive explanation might be, that you enumerate things when using a comma, like struct members or even function arguments. The definition of a trait is also an enumeration of methods.

IMO there is no need to use the C++ish syntax here (but maybe there are parsing pitfalls which enforce the semicolon here).

@bstrie
Copy link
Contributor

bstrie commented Feb 20, 2013

This is bikesheddy, but I do think it might be a net win in consistency. In any case there's not much to argue over here, so an executive fiat would be nice.

@catamorphism
Copy link
Contributor

@graydon Can you step in here and be syntax dictator?

@ghost ghost assigned graydon Feb 21, 2013
@graydon
Copy link
Contributor

graydon commented Mar 26, 2013

If you mean separating the function signatures, then semicolons. The closest syntactic symmetry is with function signatures in extern blocks -- only other place we write signatures without bodies.

@pcwalton
Copy link
Contributor

Closing as WONTFIX.

bors added a commit to rust-lang-ci/rust that referenced this issue May 2, 2020
…lip1995

Downgrade range_plus_one to pedantic

This fixes rust-lang#2217

changelog: Downgrade [`range_plus_one`] to `pedantic`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-grammar Area: The grammar of Rust A-trait-system Area: Trait system
Projects
None yet
Development

No branches or pull requests

5 participants