diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-10-10 10:33:46 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-10-14 11:06:20 +0200 |
| commit | c6de3ebd69acc627d3a8560587e5475f2240ce8a (patch) | |
| tree | dcf5e24bc6892868e8f8a7be425943437b68a2ba | |
| parent | 307a3569c5025e72e3020a393689d10a6f5e2109 (diff) | |
| download | rust-c6de3ebd69acc627d3a8560587e5475f2240ce8a.tar.gz rust-c6de3ebd69acc627d3a8560587e5475f2240ce8a.zip | |
Uncomment E0386 to let users have access to its old definition
| -rw-r--r-- | src/librustc_mir/error_codes.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/librustc_mir/error_codes.rs b/src/librustc_mir/error_codes.rs index b2d7bc6a306..93fd00c265b 100644 --- a/src/librustc_mir/error_codes.rs +++ b/src/librustc_mir/error_codes.rs @@ -875,7 +875,8 @@ x = Foo { a: 2 }; E0384: r##" This error occurs when an attempt is made to reassign an immutable variable. -For example: + +Erroneous code example: ```compile_fail,E0384 fn main() { @@ -895,13 +896,15 @@ fn main() { ``` "##, -/*E0386: r##" +E0386: r##" +#### Note: this error code is no longer emitted by the compiler. + This error occurs when an attempt is made to mutate the target of a mutable reference stored inside an immutable container. For example, this can happen when storing a `&mut` inside an immutable `Box`: -```compile_fail,E0386 +``` let mut x: i64 = 1; let y: Box<_> = Box::new(&mut x); **y = 2; // error, cannot assign to data in an immutable container @@ -925,7 +928,7 @@ let x: i64 = 1; let y: Box<Cell<_>> = Box::new(Cell::new(x)); y.set(2); ``` -"##,*/ +"##, E0387: r##" #### Note: this error code is no longer emitted by the compiler. |
