]> git.lizzy.rs Git - rust.git/commitdiff
Doc: `static mut` is unsafe too
authorSimon Sapin <simon.sapin@exyr.org>
Wed, 28 May 2014 13:19:25 +0000 (14:19 +0100)
committerSimon Sapin <simon.sapin@exyr.org>
Wed, 28 May 2014 13:19:25 +0000 (14:19 +0100)
According to the corresponding section, accessing a mutable static variable requires `unsafe` too, and I believe it counts as as language level feature. Add it to the relevant list in the Unsafety section.

src/doc/rust.md

index 4ea17e735dfcd4a4954108b8c6e4a76301062c2c..cea66fdcd6c77dad8fabc2100fd6cb43e1858ec7 100644 (file)
@@ -1036,6 +1036,7 @@ Unsafe operations are those that potentially violate the memory-safety guarantee
 The following language level features cannot be used in the safe subset of Rust:
 
   - Dereferencing a [raw pointer](#pointer-types).
+  - Reading or writing a [mutable static variable](#mutable-statics).
   - Calling an unsafe function (including an intrinsic or foreign function).
 
 ##### Unsafe functions