From 97579be23ffe4e11393c2c275f2a1a6cc57af009 Mon Sep 17 00:00:00 2001 From: Jan-Stefan Janetzky Date: Wed, 15 Jan 2025 11:18:18 +0100 Subject: [PATCH] need mutation to display the desired error without mutating `y`, instead of showing the `error: cannot assign to constant` error, you will get `error: local variable is never mutated note: consider using 'const'` --- .../version-0.13/01-language-basics/11-pointers.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/website/versioned_docs/version-0.13/01-language-basics/11-pointers.mdx b/website/versioned_docs/version-0.13/01-language-basics/11-pointers.mdx index abf5776..206d2a5 100644 --- a/website/versioned_docs/version-0.13/01-language-basics/11-pointers.mdx +++ b/website/versioned_docs/version-0.13/01-language-basics/11-pointers.mdx @@ -38,6 +38,7 @@ test "const pointers" { const x: u8 = 1; var y = &x; y.* += 1; + y = y; } ```