mirror of
https://github.com/luau-lang/rfcs.git
synced 2025-05-04 10:43:48 +01:00
I remembered this about Rust
This commit is contained in:
parent
13e148e005
commit
a80234210a
1 changed files with 2 additions and 1 deletions
|
@ -88,7 +88,8 @@ function f(
|
||||||
```
|
```
|
||||||
|
|
||||||
Trailing comma is not allowed after `...` as it is never correct to put more arguments after the ellipsis. This is consistent with:
|
Trailing comma is not allowed after `...` as it is never correct to put more arguments after the ellipsis. This is consistent with:
|
||||||
- JavaScript - Supports `function f(a, b,)`, but `function f(...a,) {}` results in "Rest parameter must be last formal parameter".
|
- JavaScript supports `function f(a, b,)`, but `function f(...a,) {}` results in "Rest parameter must be last formal parameter".
|
||||||
|
- Rust supports `Struct { a, ..Default::default() }`, but not `Struct { a, ..Default::default(), }`
|
||||||
|
|
||||||
Though this is not universally agreed upon:
|
Though this is not universally agreed upon:
|
||||||
- Rust's unstable C variadics support `unsafe extern "C" fn f(a: u32, ...,) {}`, though this syntax is not finalized.
|
- Rust's unstable C variadics support `unsafe extern "C" fn f(a: u32, ...,) {}`, though this syntax is not finalized.
|
||||||
|
|
Loading…
Add table
Reference in a new issue