Skip to content

Commit 73685af

Browse files
Add E0390 error explanation
1 parent 768111f commit 73685af

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2774,6 +2774,22 @@ For more information see the [opt-in builtin traits RFC](https://github.com/rust
27742774
-lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md).
27752775
"##,
27762776

2777+
E0390: r##"
2778+
You tried to implement on an `*mut T` type. Erroneous code example:
2779+
2780+
```
2781+
struct Foo {
2782+
x: i32
2783+
}
2784+
2785+
impl *mut Foo {}
2786+
// error: only a single inherent implementation marked with
2787+
// `#[lang = "mut_ptr"]` is allowed for the `*mut T` primitive
2788+
```
2789+
2790+
To fix this, please follow the compiler recommendations.
2791+
"##,
2792+
27772793
E0391: r##"
27782794
This error indicates that some types or traits depend on each other
27792795
and therefore cannot be constructed.
@@ -2928,8 +2944,6 @@ register_diagnostics! {
29282944
// between structures
29292945
E0377, // the trait `CoerceUnsized` may only be implemented for a coercion
29302946
// between structures with the same definition
2931-
E0390, // only a single inherent implementation marked with
2932-
// `#[lang = \"{}\"]` is allowed for the `{}` primitive
29332947
E0393, // the type parameter `{}` must be explicitly specified in an object
29342948
// type because its default value `{}` references the type `Self`"
29352949
E0399, // trait items need to be implemented because the associated

0 commit comments

Comments
 (0)