Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[E0183] Add missing error code explanation #63022

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion src/librustc_typeck/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,48 @@ fn bar(foo: Foo) -> u32 {
```
"##,

E0183: r##"
Manually implementing `Fn*` traits is experimental.
See [tracking issue #29625][iss29625] for the status of the feature.

Erroneous code example:
Karrq marked this conversation as resolved.
Show resolved Hide resolved

```compile_fail,E0183
Karrq marked this conversation as resolved.
Show resolved Hide resolved
#![feature(unboxed_closures)]
struct Echo {}

impl<A> FnOnce<(A,)> for Echo {
type Output = A;
extern "rust-call" fn call_once(self, args: (A,)) -> Self::Output {
args.0
}
}
```

To fix this error the feature `fn_traits` must be enabled with:

```
Karrq marked this conversation as resolved.
Show resolved Hide resolved
#![feature(fn_traits)]
```

Here's the above example fixed:

```
#![feature(unboxed_closures, fn_traits)]
struct Echo {}

impl<A> FnOnce<(A,)> for Echo {
type Output = A;
extern "rust-call" fn call_once(self, args: (A,)) -> Self::Output {
args.0
}
}
```

[1]: https://doc.rust-lang.org/unstable-book/library-features/fn-traits.html
[iss29625]: https://github.com/rust-lang/rust/issues/29625
"##,

E0184: r##"
Explicitly implementing both Drop and Copy for a type is currently disallowed.
This feature can make some sense in theory, but the current implementation is
Expand Down Expand Up @@ -4671,7 +4713,6 @@ register_diagnostics! {
// E0173, // manual implementations of unboxed closure traits are experimental
// E0174,
// E0182, // merged into E0229
E0183,
// E0187, // can't infer the kind of the closure
// E0188, // can not cast an immutable reference to a mutable pointer
// E0189, // deprecated: can only cast a boxed pointer to a boxed object
Expand Down