Skip to content

Commit 16f64c3

Browse files
committed
Auto merge of #26879 - GuillaumeGomez:patch-1, r=arielb1
Part of #24407. r? @Manishearth
2 parents 9f26f14 + 6f01aa0 commit 16f64c3

File tree

1 file changed

+66
-3
lines changed

1 file changed

+66
-3
lines changed

src/librustc_typeck/diagnostics.rs

+66-3
Original file line numberDiff line numberDiff line change
@@ -1550,6 +1550,31 @@ impl Foo for Bar {
15501550
```
15511551
"##,
15521552

1553+
E0191: r##"
1554+
Trait objects need to have all associated types specified. Erroneous code
1555+
example:
1556+
1557+
```
1558+
trait Trait {
1559+
type Bar;
1560+
}
1561+
1562+
type Foo = Trait; // error: the value of the associated type `Bar` (from
1563+
// the trait `Trait`) must be specified
1564+
```
1565+
1566+
Please verify you specified all associated types of the trait and that you
1567+
used the right trait. Example:
1568+
1569+
```
1570+
trait Trait {
1571+
type Bar;
1572+
}
1573+
1574+
type Foo = Trait<Bar=i32>; // ok!
1575+
```
1576+
"##,
1577+
15531578
E0192: r##"
15541579
Negative impls are only allowed for traits with default impls. For more
15551580
information see the [opt-in builtin traits RFC](https://github.com/rust-lang/
@@ -1831,6 +1856,47 @@ extern "rust-intrinsic" {
18311856
```
18321857
"##,
18331858

1859+
E0220: r##"
1860+
You used an associated type which isn't defined in the trait.
1861+
Erroneous code example:
1862+
1863+
```
1864+
trait Trait {
1865+
type Bar;
1866+
}
1867+
1868+
type Foo = Trait<F=i32>; // error: associated type `F` not found for
1869+
// `Trait`
1870+
```
1871+
1872+
Please verify you used the right trait or you didn't misspell the
1873+
associated type name. Example:
1874+
1875+
```
1876+
trait Trait {
1877+
type Bar;
1878+
}
1879+
1880+
type Foo = Trait<Bar=i32>; // ok!
1881+
```
1882+
"##,
1883+
1884+
E0232: r##"
1885+
The attribute must have a value. Erroneous code example:
1886+
1887+
```
1888+
#[rustc_on_unimplemented] // error: this attribute must have a value
1889+
trait Bar {}
1890+
```
1891+
1892+
Please supply the missing value of the attribute. Example:
1893+
1894+
```
1895+
#[rustc_on_unimplemented = "foo"] // ok!
1896+
trait Bar {}
1897+
```
1898+
"##,
1899+
18341900
E0243: r##"
18351901
This error indicates that not enough type parameters were found in a type or
18361902
trait.
@@ -2074,7 +2140,6 @@ register_diagnostics! {
20742140
E0188, // can not cast a immutable reference to a mutable pointer
20752141
E0189, // deprecated: can only cast a boxed pointer to a boxed object
20762142
E0190, // deprecated: can only cast a &-pointer to an &-object
2077-
E0191, // value of the associated type must be specified
20782143
E0193, // cannot bound type where clause bounds may only be attached to types
20792144
// involving type parameters
20802145
E0194,
@@ -2092,7 +2157,6 @@ register_diagnostics! {
20922157
E0217, // ambiguous associated type, defined in multiple supertraits
20932158
E0218, // no associated type defined
20942159
E0219, // associated type defined in higher-ranked supertrait
2095-
E0220, // associated type not found for type parameter
20962160
E0221, // ambiguous associated type in bounds
20972161
//E0222, // Error code E0045 (variadic function must have C calling
20982162
// convention) duplicate
@@ -2105,7 +2169,6 @@ register_diagnostics! {
21052169
E0229, // associated type bindings are not allowed here
21062170
E0230, // there is no type parameter on trait
21072171
E0231, // only named substitution parameters are allowed
2108-
E0232, // this attribute must have a value
21092172
E0233,
21102173
E0234,
21112174
E0235, // structure constructor specifies a structure of type but

0 commit comments

Comments
 (0)