Rollup merge of #66155 - GuillaumeGomez:long-err-explanation-E0594, r=Dylan-DPC
Add long error explanation for E0594 Part of #61137. r? @Dylan-DPC
This commit is contained in:
commit
40deec82bc
47 changed files with 88 additions and 22 deletions
|
@ -318,6 +318,7 @@ E0590: include_str!("./error_codes/E0590.md"),
|
|||
E0591: include_str!("./error_codes/E0591.md"),
|
||||
E0592: include_str!("./error_codes/E0592.md"),
|
||||
E0593: include_str!("./error_codes/E0593.md"),
|
||||
E0594: include_str!("./error_codes/E0594.md"),
|
||||
E0595: include_str!("./error_codes/E0595.md"),
|
||||
E0596: include_str!("./error_codes/E0596.md"),
|
||||
E0597: include_str!("./error_codes/E0597.md"),
|
||||
|
@ -566,7 +567,6 @@ E0744: include_str!("./error_codes/E0744.md"),
|
|||
// E0563, // cannot determine a type for this `impl Trait` removed in 6383de15
|
||||
// E0564, // only named lifetimes are allowed in `impl Trait`,
|
||||
// but `{}` was found in the type `{}`
|
||||
E0594, // cannot assign to {}
|
||||
// E0598, // lifetime of {} is too short to guarantee its contents can be...
|
||||
// E0611, // merged into E0616
|
||||
// E0612, // merged into E0609
|
||||
|
|
23
src/librustc_error_codes/error_codes/E0594.md
Normal file
23
src/librustc_error_codes/error_codes/E0594.md
Normal file
|
@ -0,0 +1,23 @@
|
|||
A non-mutable value was assigned a value.
|
||||
|
||||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0594
|
||||
struct SolarSystem {
|
||||
earth: i32,
|
||||
}
|
||||
|
||||
let ss = SolarSystem { earth: 3 };
|
||||
ss.earth = 2; // error!
|
||||
```
|
||||
|
||||
To fix this error, declare `ss` as mutable by using the `mut` keyword:
|
||||
|
||||
```
|
||||
struct SolarSystem {
|
||||
earth: i32,
|
||||
}
|
||||
|
||||
let mut ss = SolarSystem { earth: 3 }; // declaring `ss` as mutable
|
||||
ss.earth = 2; // ok!
|
||||
```
|
|
@ -72,4 +72,5 @@ LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); })
|
|||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0596`.
|
||||
Some errors have detailed explanations: E0594, E0596.
|
||||
For more information about an error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -16,3 +16,4 @@ LL | *s.pointer += 1;
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -6,3 +6,4 @@ LL | foo = 6;
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -27,5 +27,5 @@ LL | let x: &mut isize = &mut **t0;
|
|||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0502, E0596.
|
||||
Some errors have detailed explanations: E0502, E0594, E0596.
|
||||
For more information about an error, try `rustc --explain E0502`.
|
||||
|
|
|
@ -112,4 +112,5 @@ LL | *x.y_mut() = 3;
|
|||
|
||||
error: aborting due to 14 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0596`.
|
||||
Some errors have detailed explanations: E0594, E0596.
|
||||
For more information about an error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -56,4 +56,5 @@ LL | **x = 3;
|
|||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0596`.
|
||||
Some errors have detailed explanations: E0594, E0596.
|
||||
For more information about an error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -50,5 +50,5 @@ LL | let c1 = |y: &'static mut isize| x = y;
|
|||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0500, E0524.
|
||||
Some errors have detailed explanations: E0500, E0524, E0594.
|
||||
For more information about an error, try `rustc --explain E0500`.
|
||||
|
|
|
@ -96,4 +96,5 @@ LL | drop(p);
|
|||
|
||||
error: aborting due to 9 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0506`.
|
||||
Some errors have detailed explanations: E0506, E0594.
|
||||
For more information about an error, try `rustc --explain E0506`.
|
||||
|
|
|
@ -31,4 +31,5 @@ LL | s[2] = 20;
|
|||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0502`.
|
||||
Some errors have detailed explanations: E0502, E0594.
|
||||
For more information about an error, try `rustc --explain E0502`.
|
||||
|
|
|
@ -24,4 +24,5 @@ LL | let _ = &mut map["peter"];
|
|||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0596`.
|
||||
Some errors have detailed explanations: E0594, E0596.
|
||||
For more information about an error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -18,3 +18,4 @@ LL | give_any(|y| x = Some(y));
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -84,4 +84,5 @@ LL | v.y = 2;
|
|||
|
||||
error: aborting due to 9 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0382`.
|
||||
Some errors have detailed explanations: E0382, E0594.
|
||||
For more information about an error, try `rustc --explain E0382`.
|
||||
|
|
|
@ -50,4 +50,5 @@ LL | || { &mut x.0; };
|
|||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0596`.
|
||||
Some errors have detailed explanations: E0594, E0596.
|
||||
For more information about an error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -50,4 +50,5 @@ LL | || { &mut x.0; };
|
|||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0596`.
|
||||
Some errors have detailed explanations: E0594, E0596.
|
||||
For more information about an error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -375,4 +375,5 @@ LL | &mut X.0;
|
|||
|
||||
error: aborting due to 38 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0596`.
|
||||
Some errors have detailed explanations: E0594, E0596.
|
||||
For more information about an error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -15,4 +15,5 @@ LL | x.b = 22;
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0381`.
|
||||
Some errors have detailed explanations: E0381, E0594.
|
||||
For more information about an error, try `rustc --explain E0381`.
|
||||
|
|
|
@ -15,4 +15,5 @@ LL | x.0 = 1;
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0381`.
|
||||
Some errors have detailed explanations: E0381, E0594.
|
||||
For more information about an error, try `rustc --explain E0381`.
|
||||
|
|
|
@ -16,4 +16,5 @@ LL | to_fn_once(move|| { s.read_to_end(&mut Vec::new()); });
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0596`.
|
||||
Some errors have detailed explanations: E0594, E0596.
|
||||
For more information about an error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -8,3 +8,4 @@ LL | foo(Box::new(move || y = false) as Box<_>);
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -36,3 +36,4 @@ LL | *OH_YES = 99;
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -24,4 +24,5 @@ LL | s.x += 1;
|
|||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0596`.
|
||||
Some errors have detailed explanations: E0594, E0596.
|
||||
For more information about an error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -98,4 +98,5 @@ LL | *x.0 = 1;
|
|||
|
||||
error: aborting due to 12 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0596`.
|
||||
Some errors have detailed explanations: E0594, E0596.
|
||||
For more information about an error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -8,3 +8,4 @@ LL | fancy_ref.num = 6;
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -6,3 +6,4 @@ LL | NUM = 20;
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -12,3 +12,4 @@ LL | bar(move || x = 1);
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -16,3 +16,4 @@ LL | let _frob = |q: Box<isize>| { *q = 2; };
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -9,3 +9,4 @@ LL | x = 1;
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -12,4 +12,5 @@ LL | buf[0]=2;
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0017`.
|
||||
Some errors have detailed explanations: E0017, E0594.
|
||||
For more information about an error, try `rustc --explain E0017`.
|
||||
|
|
|
@ -8,3 +8,4 @@ LL | *my_ref = 0;
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -18,3 +18,4 @@ LL | *bar = 64;
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -8,3 +8,4 @@ LL | self.how_hungry -= 5;
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -8,3 +8,4 @@ LL | nyan.how_hungry = 0;
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -156,4 +156,5 @@ LL | | *x = 1;});
|
|||
|
||||
error: aborting due to 12 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0596`.
|
||||
Some errors have detailed explanations: E0594, E0596.
|
||||
For more information about an error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -6,3 +6,4 @@ LL | FOO = 6;
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -9,3 +9,4 @@ LL | x = 1;
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -8,3 +8,4 @@ LL | fancy_ref.num = 6;
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -8,3 +8,4 @@ LL | *my_ref = 0;
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -20,4 +20,5 @@ LL | g;
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0506`.
|
||||
Some errors have detailed explanations: E0506, E0594.
|
||||
For more information about an error, try `rustc --explain E0506`.
|
||||
|
|
|
@ -18,3 +18,4 @@ LL | *x += 1;
|
|||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -18,3 +18,4 @@ LL | *n += 1;
|
|||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -35,3 +35,4 @@ LL | ref quo => { *quo = 32; },
|
|||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -6,3 +6,4 @@ LL | S = "after";
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -71,4 +71,5 @@ LL | || set(&mut x);
|
|||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0596`.
|
||||
Some errors have detailed explanations: E0594, E0596.
|
||||
For more information about an error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -42,3 +42,4 @@ LL | | });
|
|||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
|
@ -16,3 +16,4 @@ LL | | });
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue