From c7e7f8fa13677386ef3e75f3cf22dfb661d2fda9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Sampaio?= Date: Mon, 18 Nov 2024 14:42:22 +0000 Subject: [PATCH] Ch20-01: Fix typos --- src/ch20-01-unsafe-rust.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch20-01-unsafe-rust.md b/src/ch20-01-unsafe-rust.md index 156c0f05ff..b3cbcac74c 100644 --- a/src/ch20-01-unsafe-rust.md +++ b/src/ch20-01-unsafe-rust.md @@ -103,7 +103,7 @@ raw pointers in safe code; we just can’t dereference raw pointers outside an unsafe block, as you’ll see in a bit. We’ve created raw pointers by using the raw borrow operators: `&raw const num` -creates a `*const i32` immutable raw pointer, and `&raw mut num` creates a `&mut +creates a `*const i32` immutable raw pointer, and `&raw mut num` creates a `*mut i32` mutable raw pointer. Because we created them directly from a local variable, we know these particular raw pointers are valid, but we can’t make that assumption about just any raw pointer. @@ -463,7 +463,7 @@ actually is safe and correct. One of the best ways to do that is to use [Miri][miri], an official Rust tool for detecting undefined behavior. Whereas the borrow checker is a *static* tool which works at compile time, Miri is a *dynamic* tool which works at runtime. It checks your code by running your -program, or its test suite, and detecting when you violate the rules its +program, or its test suite, and detecting when you violate the rules it understands about how Rust should work. Using Miri requires a nightly build of Rust (which we talk about more in