Remove E0134 and E0135 error explanation
This commit is contained in:
parent
d72c3076e1
commit
5460650eec
@ -411,42 +411,6 @@ fn main() {
|
||||
See also https://doc.rust-lang.org/book/unsafe.html
|
||||
"##,
|
||||
|
||||
E0134: r##"
|
||||
You tried to modify the str type, which isn't allowed. Erroneous code
|
||||
example:
|
||||
|
||||
```
|
||||
let s = "salut";
|
||||
let c = &mut s[0..1]; // error: modification of string types is not
|
||||
// allowed
|
||||
```
|
||||
|
||||
I you want to modify an str, please use the String type. Example:
|
||||
|
||||
```
|
||||
let mut s = "salut";
|
||||
let mut c = s[0..1].to_owned(); // ok!
|
||||
```
|
||||
"##,
|
||||
|
||||
E0135: r##"
|
||||
You tried to modify the str type, which isn't allowed. Erroneous code
|
||||
example:
|
||||
|
||||
```
|
||||
let s = "salut";
|
||||
let c = &mut (*s)[0..1]; // error: modification of string types is not
|
||||
// allowed
|
||||
```
|
||||
|
||||
If you want to modify an str, please use the String type. Example:
|
||||
|
||||
```
|
||||
let mut s = "salut";
|
||||
let mut c = s[0..1].to_owned(); // ok!
|
||||
```
|
||||
"##,
|
||||
|
||||
E0137: r##"
|
||||
This error indicates that the compiler found multiple functions with the
|
||||
`#[main]` attribute. This is an error because there must be a unique entry
|
||||
|
@ -1369,23 +1369,30 @@ struct Foo {
|
||||
"##,
|
||||
|
||||
E0128: r##"
|
||||
You declared a type parameter with a default which has the same identifier as
|
||||
the type parameter. Erroneous code example:
|
||||
Type parameter defaults can only use parameters that occur before them.
|
||||
Erroneous code example:
|
||||
|
||||
```
|
||||
pub struct Foo<SomeType=SomeType>;
|
||||
pub struct Foo<T=U, U=()> {
|
||||
field1: T,
|
||||
filed2: U,
|
||||
}
|
||||
// error: type parameters with a default cannot use forward declared
|
||||
// identifiers
|
||||
```
|
||||
|
||||
Please verify that a name clash hasn't been accidentally introduced, and rename
|
||||
the type parameter if so. Example:
|
||||
Since type parameters are evaluated in-order, you may be able to fix this issue
|
||||
by doing:
|
||||
|
||||
```
|
||||
pub struct Foo<T=SomeType> {
|
||||
value: T
|
||||
pub struct Foo<U=(), T=U> {
|
||||
field1: T,
|
||||
filed2: U,
|
||||
}
|
||||
```
|
||||
|
||||
Please also verify that this wasn't because of a name-clash and rename the type
|
||||
parameter if so.
|
||||
"##,
|
||||
|
||||
E0130: r##"
|
||||
|
Loading…
x
Reference in New Issue
Block a user