From a80234210af5f6f37be8ef1822d4ccf0d46fd440 Mon Sep 17 00:00:00 2001 From: boyned//Kampfkarren Date: Fri, 12 Jan 2024 15:07:50 -0800 Subject: [PATCH] I remembered this about Rust --- docs/trailing-commas-in-calls.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/trailing-commas-in-calls.md b/docs/trailing-commas-in-calls.md index d15065f..7f74336 100644 --- a/docs/trailing-commas-in-calls.md +++ b/docs/trailing-commas-in-calls.md @@ -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: -- 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: - Rust's unstable C variadics support `unsafe extern "C" fn f(a: u32, ...,) {}`, though this syntax is not finalized.