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

ICE:Unimplemented when trying to select an implementation for constant trait item reference. #26095

Closed
Ygg01 opened this issue Jun 8, 2015 · 2 comments
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Ygg01
Copy link

Ygg01 commented Jun 8, 2015

When running following code:

#![feature(associated_consts)]
trait HasNumber<T> {
    const Number: usize;
}

enum One {}
enum Two {}

enum Foo {}

impl<T> HasNumber<T> for One {
    const Number: usize = 1;
}

impl<T> HasNumber<T> for Two {
    const Number: usize = 2;
}

On playground nightly and beta channels I get the following error:

<anon>:3:5: 3:25 error: internal compiler error: Encountered error `Unimplemented` when trying to select an implementation for constant trait item reference.
<anon>:3     const Number: usize;
             ^~~~~~~~~~~~~~~~~~~~

I expected to not get that error.

@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jun 8, 2015
@quantheory
Copy link
Contributor

This does not seem to happen on the latest nightly.

@arielb1
Copy link
Contributor

arielb1 commented Oct 23, 2015

This does not affect 1.5.

@arielb1 arielb1 added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Oct 23, 2015
@apasel422 apasel422 mentioned this issue Oct 24, 2015
bors added a commit that referenced this issue Oct 25, 2015
Closes #22781.
Closes #23891.
Closes #24956.
Closes #25145.
Closes #25693.
Closes #26095.
Closes #26459.
Closes #27320.
Closes #27895.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants