Skip to content

Commit 6440784

Browse files
---
yaml --- r: 233648 b: refs/heads/beta c: 1ac7633 h: refs/heads/master v: v3
1 parent 98d1d71 commit 6440784

File tree

2 files changed

+42
-3
lines changed

2 files changed

+42
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 6715ec8da01816f1b3d0a0e47c88ff47d1559b4f
26+
refs/heads/beta: 1ac7633c8af439828f16a5bb09162f5475d5a6de
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_typeck/diagnostics.rs

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2423,7 +2423,7 @@ E0323: r##"
24232423
An associated const was implemented when another trait item was expected.
24242424
Erroneous code example:
24252425
2426-
```Rust
2426+
```
24272427
trait Foo {
24282428
type N;
24292429
}
@@ -2440,7 +2440,7 @@ impl Foo for Bar {
24402440
To fix this error, please check you didn't misspell the associated const
24412441
name or you did implement the good trait item. Example:
24422442
2443-
```Rust
2443+
```
24442444
struct Bar;
24452445
24462446
trait Foo {
@@ -2462,6 +2462,45 @@ impl Foo for Bar {
24622462
```
24632463
"##,
24642464

2465+
E0324: r##"
2466+
A method was implemented when another trait item was expected. Erroneous
2467+
code example:
2468+
2469+
```
2470+
struct Bar;
2471+
2472+
trait Foo {
2473+
const N : u32;
2474+
2475+
fn M();
2476+
}
2477+
2478+
impl Foo for Bar {
2479+
fn N() {}
2480+
// error: item `N` is an associated method, which doesn't match its
2481+
// trait `<Bar as Foo>`
2482+
}
2483+
```
2484+
2485+
To fix this error, please check you didn't misspell the method name. Example:
2486+
2487+
```
2488+
struct Bar;
2489+
2490+
trait Foo {
2491+
const N : u32;
2492+
2493+
fn M();
2494+
}
2495+
2496+
impl Foo for Bar {
2497+
const N : u32 = 0;
2498+
2499+
fn M() {} // ok!
2500+
}
2501+
```
2502+
"##,
2503+
24652504
E0326: r##"
24662505
The types of any associated constants in a trait implementation must match the
24672506
types in the trait definition. This error indicates that there was a mismatch.

0 commit comments

Comments
 (0)