Skip to content

Commit

Permalink
Doc: static mut is unsafe too
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
SimonSapin committed May 28, 2014
1 parent bee42a9 commit 17697c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/doc/rust.md
Expand Up @@ -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
Expand Down

5 comments on commit 17697c7

@bors
Copy link
Contributor

@bors bors commented on 17697c7 May 29, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at SimonSapin@17697c7

@bors
Copy link
Contributor

@bors bors commented on 17697c7 May 29, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging SimonSapin/rust/patch-11 = 17697c7 into auto

@bors
Copy link
Contributor

@bors bors commented on 17697c7 May 29, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SimonSapin/rust/patch-11 = 17697c7 merged ok, testing candidate = c631d3d

@bors
Copy link
Contributor

@bors bors commented on 17697c7 May 29, 2014

@bors
Copy link
Contributor

@bors bors commented on 17697c7 May 29, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = c631d3d

Please sign in to comment.