From c192af31ce7f3457ae3fb257252d38647b2cf30b Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 29 May 2022 20:30:29 +0900 Subject: [PATCH] Fix wording on the aliasing section It should've said "the value of a local variable cannot alias things...". --- src/aliasing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aliasing.md b/src/aliasing.md index 993afba..cad83d8 100644 --- a/src/aliasing.md +++ b/src/aliasing.md @@ -118,8 +118,8 @@ fn compute(input: &u32, output: &mut u32) { } ``` -We're still relying on alias analysis to assume that `temp` doesn't alias -`input`, but the proof is much simpler: the value of a local variable can't be +We're still relying on alias analysis to assume that `input` doesn't alias +`temp`, but the proof is much simpler: the value of a local variable can't be aliased by things that existed before it was declared. This is an assumption every language freely makes, and so this version of the function could be optimized the way we want in any language.