Remove E0017 from error codes index
This commit is contained in:
parent
416b439ffb
commit
e01ad6a01a
2 changed files with 0 additions and 21 deletions
|
@ -18,7 +18,6 @@ E0010: include_str!("./error_codes/E0010.md"),
|
|||
E0013: include_str!("./error_codes/E0013.md"),
|
||||
E0014: include_str!("./error_codes/E0014.md"),
|
||||
E0015: include_str!("./error_codes/E0015.md"),
|
||||
E0017: include_str!("./error_codes/E0017.md"),
|
||||
E0019: include_str!("./error_codes/E0019.md"),
|
||||
E0023: include_str!("./error_codes/E0023.md"),
|
||||
E0025: include_str!("./error_codes/E0025.md"),
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
References in statics and constants may only refer to immutable values.
|
||||
|
||||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0017
|
||||
static X: i32 = 1;
|
||||
const C: i32 = 2;
|
||||
|
||||
// these three are not allowed:
|
||||
const CR: &mut i32 = &mut C;
|
||||
static STATIC_REF: &'static mut i32 = &mut X;
|
||||
static CONST_REF: &'static mut i32 = &mut C;
|
||||
```
|
||||
|
||||
Statics are shared everywhere, and if they refer to mutable data one might
|
||||
violate memory safety since holding multiple mutable references to shared data
|
||||
is not allowed.
|
||||
|
||||
If you really want global mutable state, try using `static mut` or a global
|
||||
`UnsafeCell`.
|
Loading…
Add table
Add a link
Reference in a new issue