Skip to content

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

New issue

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

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

Already on GitHub? # to your account

Closed
petrochenkov opened this issue Nov 5, 2015 · 2 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@petrochenkov
Copy link
Contributor

Code:

#![feature(associated_consts)]

trait Tr {
    const C: Self;
}

fn main() {
    let a: u8 = Tr::C;
}

Output:

<anon>:4:5: 4:19 error: internal compiler error: Encountered error `Unimplemented` when trying to select an implementation for constant trait item reference.
<anon>:4     const C: Self;
             ^~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', ../src/libsyntax/diagnostic.rs:176

Reproduces on nightly.

@sanxiyn sanxiyn added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Nov 5, 2015
@samdoiron
Copy link

Triage: Able to reproduce on rustc 1.7.0-nightly (abf60b20a 2015-12-19)

bltavares added a commit to bltavares/glacier that referenced this issue Dec 30, 2015
@nagisa nagisa added the A-associated-items Area: Associated items (types, constants & functions) label May 16, 2016
@petrochenkov
Copy link
Contributor Author

Fixed in 1.17.0, needs test.

rustc 1.17.0-nightly (306035c21 2017-02-18)
error[E0277]: the trait bound `u8: Tr` is not satisfied
 --> <anon>:8:17
  |
8 |     let a: u8 = Tr::C;
  |                 ^^^^^ the trait `Tr` is not implemented for `u8`
  |
  = note: required by `Tr::C`

error: aborting due to previous error

@petrochenkov petrochenkov added E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. and removed A-associated-items Area: Associated items (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Feb 19, 2017
@petrochenkov petrochenkov added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Mar 1, 2017
mattico added a commit to mattico/rust that referenced this issue Mar 13, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 14, 2017
Add test for issue rust-lang#29595

Closes rust-lang#29595

Couldn't get this to run locally, all the compile-fail tests are ignored... let's see what Travis says.
frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 14, 2017
Add test for issue rust-lang#29595

Closes rust-lang#29595

Couldn't get this to run locally, all the compile-fail tests are ignored... let's see what Travis says.
frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 15, 2017
Add test for issue rust-lang#29595

Closes rust-lang#29595

Couldn't get this to run locally, all the compile-fail tests are ignored... let's see what Travis says.
frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 17, 2017
Add test for issue rust-lang#29595

Closes rust-lang#29595

Couldn't get this to run locally, all the compile-fail tests are ignored... let's see what Travis says.
frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 17, 2017
Add test for issue rust-lang#29595

Closes rust-lang#29595

Couldn't get this to run locally, all the compile-fail tests are ignored... let's see what Travis says.
frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 17, 2017
Add test for issue rust-lang#29595

Closes rust-lang#29595

Couldn't get this to run locally, all the compile-fail tests are ignored... let's see what Travis says.
frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 17, 2017
Add test for issue rust-lang#29595

Closes rust-lang#29595

Couldn't get this to run locally, all the compile-fail tests are ignored... let's see what Travis says.
frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 17, 2017
Add test for issue rust-lang#29595

Closes rust-lang#29595

Couldn't get this to run locally, all the compile-fail tests are ignored... let's see what Travis says.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Projects
None yet
Development

No branches or pull requests

4 participants