From a7fc5d4333205e0c78d2eda64b5d1c1b00cbfd98 Mon Sep 17 00:00:00 2001 From: Per <Per Lindgren> Date: Sun, 5 Nov 2017 19:02:59 +0100 Subject: [PATCH] fix --- doc/Memory.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/Memory.md b/doc/Memory.md index 0637268..f4d0067 100644 --- a/doc/Memory.md +++ b/doc/Memory.md @@ -4,15 +4,15 @@ The memory model is one unique feature that makes Rust stand out from other simi At heart, is uniqueness of references to mutable resources (memory locations). I.e., in *safe* Rust, one can either have a single mutable reference, or (one or) many immutable references to a resource, but never both (mutable and immutable references at the same time). -This property is enforced by the *borrow checker* in the `rustc` compiler, and code which breaks these properties will be rejected with a compilation error. +This property is enforced by the *borrow checker* in the `rustc` compiler, i.e., code which breaks these properties will be rejected with a compilation error. There are several advantages with the Rust memory model. To name a few: -* Foremost the Rust memory model is safe, i.e., for programs (written in *safe Rust) that passes compilation the generated code will be free of unsafe memory accesses (and thus *memory safe*). +* Foremost the Rust memory model is safe, i.e., for programs (written in *safe Rust*) that passes compilation the generated code will be free of unsafe memory accesses (and thus *memory safe*); -* The Rust memory model allows for "fearless programming", i.e., as a programmer you don't have to focus efforts on memory safety, the compiler will stop you if you do something potentially dangerous. +* The Rust memory model allows for "fearless programming", i.e., as a programmer you don't have to focus efforts on memory safety, the compiler will stop you if you do something potentially dangerous; -* Programming errors that indirectly lead to memory errors can be spoted at compile time. (E.g, attempting to change the lenght of an array `a` inside an iterator over `a` will be spoted by the compiler.) +* Programming errors that indirectly lead to memory errors can be spoted at compile time. (E.g, attempting to change the lenght of an array `a` inside an iterator over `a` will be spoted by the compiler.); * The Rust memory model allows for aggressive optimization, i.e., the compiler will host detailed information regarding the mutability of references and make *safe* assumpitions leading to efficient implementations. -- GitLab