Rollup merge of #69346 - GuillaumeGomez:clean-up-e032x-explanations, r=Dylan-DPC
Clean up E0323, E0324, E0325 and E0326 explanations r? @Dylan-DPC
This commit is contained in:
commit
1cb9fb5e16
4 changed files with 10 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
||||||
An associated const was implemented when another trait item was expected.
|
An associated const was implemented when another trait item was expected.
|
||||||
|
|
||||||
Erroneous code example:
|
Erroneous code example:
|
||||||
|
|
||||||
```compile_fail,E0323
|
```compile_fail,E0323
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
A method was implemented when another trait item was expected. Erroneous
|
A method was implemented when another trait item was expected.
|
||||||
code example:
|
|
||||||
|
Erroneous code example:
|
||||||
|
|
||||||
```compile_fail,E0324
|
```compile_fail,E0324
|
||||||
struct Bar;
|
struct Bar;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
An associated type was implemented when another trait item was expected.
|
An associated type was implemented when another trait item was expected.
|
||||||
|
|
||||||
Erroneous code example:
|
Erroneous code example:
|
||||||
|
|
||||||
```compile_fail,E0325
|
```compile_fail,E0325
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
The types of any associated constants in a trait implementation must match the
|
An implementation of a trait doesn't match the type contraint.
|
||||||
types in the trait definition. This error indicates that there was a mismatch.
|
|
||||||
|
|
||||||
Here's an example of this error:
|
Erroneous code example:
|
||||||
|
|
||||||
```compile_fail,E0326
|
```compile_fail,E0326
|
||||||
trait Foo {
|
trait Foo {
|
||||||
|
@ -14,3 +13,6 @@ impl Foo for Bar {
|
||||||
const BAR: u32 = 5; // error, expected bool, found u32
|
const BAR: u32 = 5; // error, expected bool, found u32
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The types of any associated constants in a trait implementation must match the
|
||||||
|
types in the trait definition.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue