@@ -397,6 +397,114 @@ impl Bar {
397
397
```
398
398
"## ,
399
399
400
+ E0412 : r##"
401
+ An undeclared type name was used. Example of erroneous codes:
402
+
403
+ ```
404
+ impl Something {} // error: use of undeclared type name `Something`
405
+ // or:
406
+ trait Foo {
407
+ fn bar(N); // error: use of undeclared type name `N`
408
+ }
409
+ // or:
410
+ fn foo(x: T) {} // error: use of undeclared type name `T`
411
+ ```
412
+
413
+ To fix this error, please verify you didn't misspell the type name,
414
+ you did declare it or imported it into the scope. Examples:
415
+
416
+ ```
417
+ struct Something;
418
+
419
+ impl Something {} // ok!
420
+ // or:
421
+ trait Foo {
422
+ type N;
423
+
424
+ fn bar(Self::N); // ok!
425
+ }
426
+ //or:
427
+ fn foo<T>(x: T) {} // ok!
428
+ ```
429
+ "## ,
430
+
431
+ E0413 : r##"
432
+ A declaration shadows an enum variant or unit-like struct in scope.
433
+ Example of erroneous code:
434
+
435
+ ```
436
+ struct Foo;
437
+
438
+ let Foo = 12i32; // error: declaration of `Foo` shadows an enum variant or
439
+ // unit-like struct in scope
440
+ ```
441
+
442
+
443
+ To fix this error, rename the variable such that it doesn't shadow any enum
444
+ variable or structure in scope. Example:
445
+
446
+ ```
447
+ struct Foo;
448
+
449
+ let foo = 12i32; // ok!
450
+ ```
451
+
452
+ Or:
453
+
454
+ ```
455
+ struct FooStruct;
456
+
457
+ let Foo = 12i32; // ok!
458
+ ```
459
+
460
+ The goal here is to avoid a conflict of names.
461
+ "## ,
462
+
463
+ E0415 : r##"
464
+ More than one function parameter have the same name. Example of erroneous
465
+ code:
466
+
467
+ ```
468
+ fn foo(f: i32, f: i32) {} // error: identifier `f` is bound more than
469
+ // once in this parameter list
470
+ ```
471
+
472
+ Please verify you didn't misspell parameters' name. Example:
473
+
474
+ ```
475
+ fn foo(f: i32, g: i32) {} // ok!
476
+ ```
477
+ "## ,
478
+
479
+ E0416 : r##"
480
+ An identifier is bound more than once in a pattern. Example of erroneous
481
+ code:
482
+
483
+ ```
484
+ match (1, 2) {
485
+ (x, x) => {} // error: identifier `x` is bound more than once in the
486
+ // same pattern
487
+ }
488
+ ```
489
+
490
+ Please verify you didn't misspell identifiers' name. Example:
491
+
492
+ ```
493
+ match (1, 2) {
494
+ (x, y) => {} // ok!
495
+ }
496
+ ```
497
+
498
+ Or maybe did you mean to unify? Consider using a guard:
499
+
500
+ ```
501
+ match (A, B, C) {
502
+ (x, x2, see) if x == x2 => { /* A and B are equal, do one thing */ }
503
+ (y, z, see) => { /* A and B unequal; do another thing */ }
504
+ }
505
+ ```
506
+ "## ,
507
+
400
508
E0417 : r##"
401
509
A static variable was referenced in a pattern. Example of erroneous code:
402
510
@@ -425,6 +533,55 @@ match 0 {
425
533
```
426
534
"## ,
427
535
536
+ E0419 : r##"
537
+ An unknown enum variant, struct or const was used. Example of
538
+ erroneous code:
539
+
540
+ ```
541
+ match 0 {
542
+ Something::Foo => {} // error: unresolved enum variant, struct
543
+ // or const `Foo`
544
+ }
545
+ ```
546
+
547
+ Please verify you didn't misspell it and the enum variant, struct or const has
548
+ been declared and imported into scope. Example:
549
+
550
+ ```
551
+ enum Something {
552
+ Foo,
553
+ NotFoo,
554
+ }
555
+
556
+ match Something::NotFoo {
557
+ Something::Foo => {} // ok!
558
+ _ => {}
559
+ }
560
+ ```
561
+ "## ,
562
+
563
+ E0423 : r##"
564
+ A `struct` variant name was used like a function name. Example of
565
+ erroneous code:
566
+
567
+ ```
568
+ struct Foo { a: bool};
569
+
570
+ let f = Foo();
571
+ // error: `Foo` is a struct variant name, but this expression uses
572
+ // it like a function name
573
+ ```
574
+
575
+ Please verify you didn't misspell the name of what you actually wanted
576
+ to use here. Example:
577
+
578
+ ```
579
+ fn Foo() -> u32 { 0 }
580
+
581
+ let f = Foo(); // ok!
582
+ ```
583
+ "## ,
584
+
428
585
E0424 : r##"
429
586
The `self` keyword was used in a static method. Example of erroneous code:
430
587
@@ -582,6 +739,27 @@ use something_which_doesnt_exist;
582
739
Please verify you didn't misspell the import's name.
583
740
"## ,
584
741
742
+ E0435 : r##"
743
+ A non-constant value was used to initialise a constant. Example of erroneous
744
+ code:
745
+
746
+ ```
747
+ let foo = 42u32;
748
+ const FOO : u32 = foo; // error: attempt to use a non-constant value in a
749
+ // constant
750
+ ```
751
+
752
+ To fix this error, please replace the value with a constant. Example:
753
+
754
+ ```
755
+ const FOO : u32 = 42u32; // ok!
756
+
757
+ // or:
758
+ const OTHER_FOO : u32 = 42u32;
759
+ const FOO : u32 = OTHER_FOO; // ok!
760
+ ```
761
+ "## ,
762
+
585
763
E0437 : r##"
586
764
Trait implementations can only implement associated types that are members of
587
765
the trait in question. This error indicates that you attempted to implement
@@ -650,21 +828,12 @@ register_diagnostics! {
650
828
// pattern #1
651
829
E0410 , // variable from pattern is not bound in pattern 1
652
830
E0411 , // use of `Self` outside of an impl or trait
653
- E0412 , // use of undeclared
654
- E0413 , // declaration of shadows an enum variant or unit-like struct in
655
- // scope
656
831
E0414 , // only irrefutable patterns allowed here
657
- E0415 , // identifier is bound more than once in this parameter list
658
- E0416 , // identifier is bound more than once in the same pattern
659
832
E0418 , // is not an enum variant, struct or const
660
- E0419 , // unresolved enum variant, struct or const
661
833
E0420 , // is not an associated const
662
834
E0421 , // unresolved associated const
663
835
E0422 , // does not name a structure
664
- E0423 , // is a struct variant name, but this expression uses it like a
665
- // function name
666
836
E0427 , // cannot use `ref` binding mode with ...
667
837
E0429 , // `self` imports are only allowed within a { } list
668
838
E0434 , // can't capture dynamic environment in a fn item
669
- E0435 , // attempt to use a non-constant value in a constant
670
839
}
0 commit comments