File tree 2 files changed +14
-43
lines changed
2 files changed +14
-43
lines changed Original file line number Diff line number Diff line change @@ -411,42 +411,6 @@ fn main() {
411
411
See also https://doc.rust-lang.org/book/unsafe.html
412
412
"## ,
413
413
414
- E0134 : r##"
415
- You tried to modify the str type, which isn't allowed. Erroneous code
416
- example:
417
-
418
- ```
419
- let s = "salut";
420
- let c = &mut s[0..1]; // error: modification of string types is not
421
- // allowed
422
- ```
423
-
424
- I you want to modify an str, please use the String type. Example:
425
-
426
- ```
427
- let mut s = "salut";
428
- let mut c = s[0..1].to_owned(); // ok!
429
- ```
430
- "## ,
431
-
432
- E0135 : r##"
433
- You tried to modify the str type, which isn't allowed. Erroneous code
434
- example:
435
-
436
- ```
437
- let s = "salut";
438
- let c = &mut (*s)[0..1]; // error: modification of string types is not
439
- // allowed
440
- ```
441
-
442
- If you want to modify an str, please use the String type. Example:
443
-
444
- ```
445
- let mut s = "salut";
446
- let mut c = s[0..1].to_owned(); // ok!
447
- ```
448
- "## ,
449
-
450
414
E0137 : r##"
451
415
This error indicates that the compiler found multiple functions with the
452
416
`#[main]` attribute. This is an error because there must be a unique entry
Original file line number Diff line number Diff line change @@ -1369,23 +1369,30 @@ struct Foo {
1369
1369
"## ,
1370
1370
1371
1371
E0128 : r##"
1372
- You declared a type parameter with a default which has the same identifier as
1373
- the type parameter. Erroneous code example:
1372
+ Type parameter defaults can only use parameters that occur before them.
1373
+ Erroneous code example:
1374
1374
1375
1375
```
1376
- pub struct Foo<SomeType=SomeType>;
1376
+ pub struct Foo<T=U, U=()> {
1377
+ field1: T,
1378
+ filed2: U,
1379
+ }
1377
1380
// error: type parameters with a default cannot use forward declared
1378
1381
// identifiers
1379
1382
```
1380
1383
1381
- Please verify that a name clash hasn't been accidentally introduced, and rename
1382
- the type parameter if so. Example :
1384
+ Since type parameters are evaluated in-order, you may be able to fix this issue
1385
+ by doing :
1383
1386
1384
1387
```
1385
- pub struct Foo<T=SomeType> {
1386
- value: T
1388
+ pub struct Foo<U=(), T=U> {
1389
+ field1: T,
1390
+ filed2: U,
1387
1391
}
1388
1392
```
1393
+
1394
+ Please also verify that this wasn't because of a name-clash and rename the type
1395
+ parameter if so.
1389
1396
"## ,
1390
1397
1391
1398
E0130 : r##"
You can’t perform that action at this time.
0 commit comments