Skip to content

E0283 error explain #28469

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

Merged
merged 1 commit into from
Dec 31, 2015
Merged
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
41 changes: 40 additions & 1 deletion src/librustc/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,46 @@ This will fail because the compiler does not know which instance of `Foo` to
call `bar` on. Change `Foo::bar()` to `Foo::<T>::bar()` to resolve the error.
"##,

E0283: r##"
This error occurs when the compiler doesn't have enough information
to unambiguously choose an implementation.

For example:

```
trait Generator {
fn create() -> u32;
}

struct Impl;
impl Generator for Impl {
fn create() -> u32 { 1 }
}

struct AnotherImpl;
impl Generator for AnotherImpl {
fn create() -> u32 { 2 }
}

fn main() {
let cont: u32 = Generator::create();
// error, impossible to choose one of Generator trait implementation
// Impl or AnotherImpl? Maybe anything else?
}
```

To resolve this error use the concrete type:

```
fn main() {
let gen1 = AnotherImpl::create();

// if there are multiple methods with same name (different traits)
let gen2 = <AnotherImpl as Generator>::create();
}
```
"##,

E0296: r##"
This error indicates that the given recursion limit could not be parsed. Ensure
that the value provided is a positive integer between quotes, like so:
Expand Down Expand Up @@ -1900,7 +1940,6 @@ register_diagnostics! {
E0278, // requirement is not satisfied
E0279, // requirement is not satisfied
E0280, // requirement is not satisfied
E0283, // cannot resolve type
E0284, // cannot resolve type
E0285, // overflow evaluation builtin bounds
E0298, // mismatched types between arms
Expand Down