From 1c1c3d38d8283159847b31c58a782200c388d69c Mon Sep 17 00:00:00 2001 From: MaschitaG <121792732+MaschitaG@users.noreply.github.com> Date: Mon, 2 Jan 2023 10:12:56 +0100 Subject: [PATCH 1/3] Unsafe Rust Unsafe Rust is mentioned in the course --- src/welcome.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/welcome.md b/src/welcome.md index c4cef244..8361bc7a 100644 --- a/src/welcome.md +++ b/src/welcome.md @@ -33,10 +33,6 @@ Some non-goals of this course are: * Learn how to develop macros, please see [Chapter 19.5 in the Rust Book](https://doc.rust-lang.org/book/ch19-06-macros.html) and [Rust by Example](https://doc.rust-lang.org/rust-by-example/macros.html) instead. -* Learn the details of how to write unsafe Rust. We will talk about unsafe Rust - on Day 3, but we do not cover the subtle details. Please see [Chapter 19.1 in - the Rust Book](https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html) and - the [Rustonomicon](https://doc.rust-lang.org/nomicon/) instead. ## Assumptions From b2ae19b5fde8d3d63980887c68ee5eafe7ab2303 Mon Sep 17 00:00:00 2001 From: MaschitaG <121792732+MaschitaG@users.noreply.github.com> Date: Mon, 2 Jan 2023 10:25:39 +0100 Subject: [PATCH 2/3] Update static-and-const.md --- src/basic-syntax/static-and-const.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic-syntax/static-and-const.md b/src/basic-syntax/static-and-const.md index 4576ea19..dbe359c8 100644 --- a/src/basic-syntax/static-and-const.md +++ b/src/basic-syntax/static-and-const.md @@ -36,4 +36,4 @@ fn main() { } ``` -We will look at mutating static data in the chapter on Unsafe Rust. +We will look at mutating static data in the [chapter on Unsafe Rust](../unsafe.md). From b027db02417d61cc99a0d8e53fb33b5a95de1eff Mon Sep 17 00:00:00 2001 From: Martin Geisler <martin@geisler.net> Date: Mon, 2 Jan 2023 10:30:40 +0100 Subject: [PATCH 3/3] Add back links to the Rust Book I think it's important that we link the students to the full information about Unsafe Rust. --- src/unsafe.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/unsafe.md b/src/unsafe.md index 0ce06369..ec9b9d44 100644 --- a/src/unsafe.md +++ b/src/unsafe.md @@ -6,13 +6,16 @@ The Rust language has two parts: * **Unsafe Rust:** can trigger undefined behavior if preconditions are violated. We will be seeing mostly safe Rust in this course, but it's important to know -what unsafe Rust is. +what Unsafe Rust is. Unsafe Rust gives you access to five new capabilities: * Dereference raw pointers. * Access or modify mutable static variables. * Access `union` fields. -* Call `unsafe` functions, including `extern` functions +* Call `unsafe` functions, including `extern` functions. * Implement `unsafe` traits. +We will briefly cover these capabilities next. For full details, please see +[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html) +and the [Rustonomicon](https://doc.rust-lang.org/nomicon/).