# Allow more semicolons

**URL:** <https://internals.rust-lang.org/t/allow-more-semicolons/7762>\
**Category:** language design\
**Created:** [June 20, 2018, 10:19pm UTC](https://internals.rust-lang.org/t/allow-more-semicolons/7762 "2018-06-20T22:19:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![notriddle](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/notriddle/32/14082_2.png) [@notriddle](https://internals.rust-lang.org/u/notriddle)\
**Post date:** [June 20, 2018, 10:19pm UTC](https://internals.rust-lang.org/t/allow-more-semicolons/7762/1 "2018-06-20T22:19:27Z")

</div>

Continuing the discussion from [Make (Some) Separators Optional](https://internals.rust-lang.org/t/make-some-separators-optional/4846/55):

What would it take to allow semicolons after curly brace-delimited items? Like this?

```
// not valid Rust
struct MyStruct {
};
fn my_fn() {
};

```

There are two big reasons to want to allow this:

1. They’re already allowed in function bodies, where they parse as empty statements. Not allowing them outside the functions seems inconsistent with that. In other words, this is already valid:

2. For non-brace-delimited items, semicolons are not only allowed, they’re required. This includes not only things that obvious need delimiters, like this unit-like struct:

---

<div class="post-metadata">

**Author:** ![Centril](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/centril/32/3334_2.png) [@Centril](https://internals.rust-lang.org/u/Centril)\
**Post date:** [June 20, 2018, 10:53pm UTC](https://internals.rust-lang.org/t/allow-more-semicolons/7762/2 "2018-06-20T22:53:38Z")

</div>

Me and @ExpHP wrote an RFC allowing this a few days ago. Sorry, should have linked in the thread 😉

The exact technical solution are somewhat up in the air atm.

> <https://github.com/rust-lang/rfcs/pull/2479>

---

<div class="post-metadata">

**Author:** ![notriddle](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/notriddle/32/14082_2.png) [@notriddle](https://internals.rust-lang.org/u/notriddle)\
**Post date:** [March 25, 2019, 8:30am UTC](https://internals.rust-lang.org/t/allow-more-semicolons/7762/3 "2019-03-25T08:30:24Z")

</div>

Closed on March 25, 2019, 8:30am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
