From 90e17641897946faa037d87fbfbba2f366aba087 Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Fri, 22 Jul 2022 16:18:38 +0200 Subject: [PATCH] another noalias fix --- content/posts/box-is-a-unique-type.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/posts/box-is-a-unique-type.md b/content/posts/box-is-a-unique-type.md index 818aba9..ef0873e 100644 --- a/content/posts/box-is-a-unique-type.md +++ b/content/posts/box-is-a-unique-type.md @@ -87,7 +87,7 @@ define void @takes_box_and_ptr_to_it(i8* noalias %0, i8* %ptr) { See the little attribute on the first parameter called `noalias`? That's what's doing the magic here. `noalias` is an LLVM attribute on pointers that allows for various optimizations. If there are two pointers, -and at least one of them is `noalias`, there are some restrictions around the two: +and at least one of them is `noalias`, there are some restrictions around the two. Approximately: - If one of them writes, they must not point to the same value (alias each other) - If neither of them writes, they can alias just fine. Therefore, we also apply `noalias` to `&mut T` and `&T` (if it doesn't contain interior mutability through