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 when assigning to member function pointer variable #24327

Closed
maghoff opened this issue Apr 11, 2015 · 1 comment
Closed

ICE when assigning to member function pointer variable #24327

maghoff opened this issue Apr 11, 2015 · 1 comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@maghoff
Copy link

maghoff commented Apr 11, 2015

When I attempt to assign to a variable of type &fn(&B), other than in the declaration of the variable, I get an unexpected panic in the compiler.

I tried this code:

struct B;

impl B {
    fn func(&self) { }
}

fn main() {
    let mut y = &B::func;
    y = &B::func;
}

I expected to see this happen: It should compile.

Instead, this happened: I got an internal compiler error:

error: internal compiler error: unexpected panic
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 'path not fully resolved: PathResolution { base_def: DefTy(DefId { krate: 0, node: 4 }, false), last_private: LastMod(AllPublic), depth: 1 }', /home/mag/prog/rust/src/librustc/middle/def.rs:80

Meta

rustc --version --verbose:

rustc 1.0.0-dev (3a8275397 2015-04-11) (built 2015-04-11)
binary: rustc
commit-hash: 3a8275397a156b17331e16393e5e1ba89ab4de3f
commit-date: 2015-04-11
build-date: 2015-04-11
host: x86_64-unknown-linux-gnu
release: 1.0.0-dev

Backtrace:

stack backtrace:
   1:     0x7f5f64435779 - sys::backtrace::write::h1fb912b6242676e13JC
   2:     0x7f5f6445a067 - panicking::on_panic::h49b58f19dee2b6499aJ
   3:     0x7f5f643a3fb2 - rt::unwind::begin_unwind_inner::h954a8c2d8b458b8ehQI
   4:     0x7f5f643a427f - rt::unwind::begin_unwind_fmt::h8142be88e287f416VOI
   5:     0x7f5f623b1fe0 - middle::ty::resolve_expr::h468519011c7f5a2dsB6
   6:     0x7f5f625032b1 - middle::ty::expr_kind::h13d00213be0997d6yD6
   7:     0x7f5f6250307a - middle::ty::expr_is_lval::he8576d1b1ffb6fb6vC6
   8:     0x7f5f6323ac60 - check::check_expr_with_unifier::h1234167007494092036
   9:     0x7f5f63252f71 - check::check_expr_with_unifier::h13727019484792908569
  10:     0x7f5f63207604 - check::check_block_with_expected::h8460ca5f594c8570Nps
  11:     0x7f5f631eb196 - check::check_fn::hd5196d54a6852698Abo
  12:     0x7f5f63202f97 - check::check_bare_fn::h0073eb2d0e87712990n
  13:     0x7f5f631fcb58 - check::check_item::hef34ffea35346370Ujo
  14:     0x7f5f632c3fb6 - check_crate::closure.36498
  15:     0x7f5f632bf3f0 - check_crate::h679eb3dc01c34e66zxC
  16:     0x7f5f64aad938 - driver::phase_3_run_analysis_passes::h7b112f16caf4f0fcpGa
  17:     0x7f5f64a8ea05 - driver::compile_input::hb07383d8b05653e9Qba
  18:     0x7f5f64b4d6e1 - run_compiler::hd11be756ecff4a4dL4b
  19:     0x7f5f64b4b332 - boxed::F.FnBox<A>::call_box::h9743051768958258733
  20:     0x7f5f64b4a869 - rt::unwind::try::try_fn::h3770862294174962809
  21:     0x7f5f644da5f8 - rust_try_inner
  22:     0x7f5f644da5e5 - rust_try
  23:     0x7f5f64b4ab18 - boxed::F.FnBox<A>::call_box::h17316511360530184554
  24:     0x7f5f644479e1 - sys::thread::create::thread_start::h14fabfa97526362frLH
  25:     0x7f5f5edd20a4 - start_thread
  26:     0x7f5f6400dcfc - __clone
  27:                0x0 - <unknown>

This issue could be related to a similar issue I also discovered: #24322

@jdm jdm added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Apr 11, 2015
@arielb1
Copy link
Contributor

arielb1 commented Jun 21, 2015

duplicate of #24322

@arielb1 arielb1 closed this as completed Jun 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants