Skip to content

Undefined nested associated type causes ICE #22384

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

Closed
solson opened this issue Feb 15, 2015 · 0 comments · Fixed by #24193
Closed

Undefined nested associated type causes ICE #22384

solson opened this issue Feb 15, 2015 · 0 comments · Fixed by #24193
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

@solson
Copy link
Member

solson commented Feb 15, 2015

Playpen link

trait Trait {
    fn foo();
}

fn main() {
    <<i32 as Copy>::foobar as Trait>::foo();
    // In general, <<Type as AnyTraitTheTypeImplements>::anything as AnyTrait>::method();
}

The above causes the following the following error:

<anon>:6:6: 6:27 error: internal compiler error: Cannot project an associated type from `VtableBuiltin(nested=[[];[];[]])`
<anon>:6     <<i32 as Copy>::foobar as Trait>::foo();
              ^~~~~~~~~~~~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:129

It works correctly if foobar is actually a defined associated type.

@jdm jdm added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Feb 15, 2015
@ghost ghost added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Apr 3, 2015
Manishearth added a commit to Manishearth/rust that referenced this issue Apr 9, 2015
Manishearth added a commit to Manishearth/rust that referenced this issue Apr 9, 2015
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

Successfully merging a pull request may close this issue.

2 participants