File tree Expand file tree Collapse file tree 2 files changed +44
-2
lines changed
branches/beta/src/librustc_typeck Expand file tree Collapse file tree 2 files changed +44
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
23
23
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
24
24
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
25
25
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26
- refs/heads/beta: 8ef395fb7fba3b38e4b6aa4ff0d4b0db1524ee47
26
+ refs/heads/beta: 6715ec8da01816f1b3d0a0e47c88ff47d1559b4f
27
27
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28
28
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
29
29
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
Original file line number Diff line number Diff line change @@ -2419,6 +2419,49 @@ for types as needed by the compiler, and it is currently disallowed to
2419
2419
explicitly implement it for a type.
2420
2420
"## ,
2421
2421
2422
+ E0323 : r##"
2423
+ An associated const was implemented when another trait item was expected.
2424
+ Erroneous code example:
2425
+
2426
+ ```Rust
2427
+ trait Foo {
2428
+ type N;
2429
+ }
2430
+
2431
+ struct Bar;
2432
+
2433
+ impl Foo for Bar {
2434
+ const N : u32 = 0;
2435
+ // error: item `N` is an associated const, which doesn't match its
2436
+ // trait `<Bar as Foo>`
2437
+ }
2438
+ ```
2439
+
2440
+ To fix this error, please check you didn't misspell the associated const
2441
+ name or you did implement the good trait item. Example:
2442
+
2443
+ ```Rust
2444
+ struct Bar;
2445
+
2446
+ trait Foo {
2447
+ type N;
2448
+ }
2449
+
2450
+ impl Foo for Bar {
2451
+ type N = u32; // ok!
2452
+ }
2453
+
2454
+ // or:
2455
+ trait Foo {
2456
+ const N : u32;
2457
+ }
2458
+
2459
+ impl Foo for Bar {
2460
+ const N : u32 = 0; // ok!
2461
+ }
2462
+ ```
2463
+ "## ,
2464
+
2422
2465
E0326 : r##"
2423
2466
The types of any associated constants in a trait implementation must match the
2424
2467
types in the trait definition. This error indicates that there was a mismatch.
@@ -2790,7 +2833,6 @@ register_diagnostics! {
2790
2833
E0319 , // trait impls for defaulted traits allowed just for structs/enums
2791
2834
E0320 , // recursive overflow during dropck
2792
2835
E0321 , // extended coherence rules for defaulted traits violated
2793
- E0323 , // implemented an associated const when another trait item expected
2794
2836
E0324 , // implemented a method when another trait item expected
2795
2837
E0325 , // implemented an associated type when another trait item expected
2796
2838
E0328 , // cannot implement Unsize explicitly
You can’t perform that action at this time.
0 commit comments