From 768764787ff0cbd2a595a19e392442a4deaae316 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Thu, 29 Sep 2022 10:52:05 -0700 Subject: [PATCH] Fix x/_ and y/z in faq example. (#2230) --- docs/project/faq.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/project/faq.md b/docs/project/faq.md index d5378fc65dae..03e3c87c628a 100644 --- a/docs/project/faq.md +++ b/docs/project/faq.md @@ -366,14 +366,14 @@ variable binding. For example: var ((x: i32, _: i32), y: auto) = ((1, 2), (3, 4)); ``` -This code is valid, and initializes `x` to `1` and `z` to `(3, 4)`. In the +This code is valid, and initializes `x` to `1` and `y` to `(3, 4)`. In the future, we will probably also support destructuring structs in a similar way, and many other kinds of patterns are possible. Now consider how that example would look if the `var` token were not required: ``` -((_: i32, x: i32), y: auto) = ((1, 2), (3, 4)); +((x: i32, _: i32), y: auto) = ((1, 2), (3, 4)); ``` With this example, the parser would need to look four tokens ahead to determine