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: can't find associated type #18210

Closed
GuillaumeGomez opened this issue Oct 21, 2014 · 2 comments
Closed

ICE: can't find associated type #18210

GuillaumeGomez opened this issue Oct 21, 2014 · 2 comments
Labels
A-associated-items Area: Associated items (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@GuillaumeGomez
Copy link
Member

Hey, here is my code (which is not supposed to work by the way) :

pub trait GValuePrivate {
    type Ret;

    fn get_gvalue(&self) -> *const <Self as GValuePrivate>::Ret {
        self
    }
}

impl GValuePrivate for i32 {}

Here's the backtrace :

src/gtk/traits/value.rs:42:6: 42:19 error: internal compiler error: ImplCtxt::associated_type_binding(): didn't find associated type
src/gtk/traits/value.rs:42 impl GValuePrivate for i32 {}
                                ^~~~~~~~~~~~~
note: the compiler hit an unexpected failure path. 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
task 'rustc' failed at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/diagnostic.rs:116

stack backtrace:
   1:     0x7f974df0c860 - rt::backtrace::imp::write::he1d07ecb5c09ef73Ocq
   2:     0x7f974df0f990 - failure::on_fail::h76802abdf02d9229byq
   3:     0x7f9752481ac0 - unwind::begin_unwind_inner::hb92ca1198fd23157Yxd
   4:     0x7f974f2d3ec0 - unwind::begin_unwind::h9730348371336326902
   5:     0x7f974f2d3e40 - diagnostic::SpanHandler::span_bug::h9d432d9518c523bfCMF
   6:     0x7f97531f9010 - middle::typeck::collect::ImplCtxt<'a, 'tcx>.AstConv<'tcx>::associated_type_binding::h242c9ff65dee50cacpi
   7:     0x7f97532161b0 - middle::typeck::astconv::ast_path_substs::h3982509238564075644
   8:     0x7f9753215f50 - middle::typeck::astconv::ast_path_to_trait_ref::h1834174999553688290
   9:     0x7f9753151020 - middle::typeck::collect::convert::h2c246fdf38b25c3cGIi
  10:     0x7f97531553b0 - visit::walk_item::h14094525741500740573
  11:     0x7f97531553b0 - visit::walk_item::h14094525741500740573
  12:     0x7f97531553b0 - visit::walk_item::h14094525741500740573
  13:     0x7f9753149dc0 - middle::typeck::collect::collect_item_types::hbcddf06b64541eabEJh
  14:     0x7f9752ae4c90 - util::common::time::h13858161161014839769
  15:     0x7f9753328cf0 - middle::typeck::check_crate::h81dc5bd97e39d0a5own
  16:     0x7f97533951b0 - driver::driver::phase_3_run_analysis_passes::h04ee49849c18416b69z
  17:     0x7f9753390630 - driver::driver::compile_input::hd4ba06b74713782dRQz
  18:     0x7f975341b350 - driver::run_compiler::h014078c5025dc703vDD
  19:     0x7f975341b200 - driver::run::closure.145641
  20:     0x7f9752afeb20 - task::TaskBuilder<S>::try_future::closure.103153
  21:     0x7f9752afe900 - task::TaskBuilder<S>::spawn_internal::closure.103124
  22:     0x7f97527cb740 - task::NativeSpawner.Spawner::spawn::closure.8435
  23:     0x7f97524dad10 - rust_try_inner
  24:     0x7f97524dad00 - rust_try
  25:     0x7f975247f380 - unwind::try::hdee5a3b0466d278eGmd
  26:     0x7f975247f200 - task::Task::run::h27d9c4b6d2601e28kCc
  27:     0x7f97527cb480 - task::NativeSpawner.Spawner::spawn::closure.8375
  28:     0x7f9752480ad0 - thread::thread_start::h5e6e53ee3afb8775vWc
  29:     0x7f974d2b60c0 - start_thread
  30:     0x7f9752149f89 - __clone
  31:                0x0 - <unknown>

Could not compile `rgtk`.

And my version rust version :

rustc 0.13.0-nightly (6ef8392b3 2014-10-20 22:17:49 +0000)

Good luck !

@kmcallister kmcallister added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Oct 22, 2014
@quantheory
Copy link
Contributor

I had a similar issue; I believe that this is a dup of #17359.

@huonw huonw added the A-associated-items Area: Associated items (types, constants & functions) label Nov 20, 2014
@nikomatsakis
Copy link
Contributor

No longer reproduces, I get legitimate compilation errors now as expected.

lnicola pushed a commit to lnicola/rust that referenced this issue Oct 8, 2024
fix: Fix resolution of label inside macro

When working on Something Else (TM) (I left a hint in the commits :P), I noticed to my surprise that labels inside macros are not resolved. This led to a discovery of *two* unrelated bugs, which are hereby fixed in two commits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

5 participants