Skip to content

Commit a481c4e

Browse files
Add E0117 error explanation
1 parent edf6132 commit a481c4e

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/librustc_typeck/diagnostics.rs

+20-1
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,26 @@ impl Bytes { ... } // error, same as above
12441244
```
12451245
"##,
12461246

1247+
E0117: r##"
1248+
You tried to implement a trait on a type which isn't defined in your crate.
1249+
Erroneous code example:
1250+
1251+
```
1252+
impl Drop for u32 {}
1253+
```
1254+
1255+
The type on which you want to implement the trait has to be defined in
1256+
your crate. Example:
1257+
1258+
```
1259+
pub struct Foo; // you define your type in your crate
1260+
1261+
impl Drop for Foo { // and you can implement the trait on it!
1262+
// code of trait implementation here
1263+
}
1264+
```
1265+
"##,
1266+
12471267
E0121: r##"
12481268
In order to be consistent with Rust's lack of global type inference, type
12491269
placeholders are disallowed by design in item signatures.
@@ -1826,7 +1846,6 @@ register_diagnostics! {
18261846
E0102,
18271847
E0103,
18281848
E0104,
1829-
E0117,
18301849
E0118,
18311850
E0119,
18321851
E0120,

0 commit comments

Comments
 (0)