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

"the compiler hit an unexpected failure path": implementing Drop on struct with closure field #15455

Closed
DanielKeep opened this issue Jul 5, 2014 · 1 comment

Comments

@DanielKeep
Copy link
Contributor

Failure with rustc 0.11.0-pre-nightly (5d5c20647f45f2eb74f337e5434bbe63b0c43345 2014-07-03 21:46:47 +0000), running on 64-bit Windows 7 SP1.

Source file src\bug.rs:

fn main() {
}

struct OnExitSentinel<'a> {
    block: ||: 'a,
}

impl<'a> Drop for OnExitSentinel<'a> {
    fn drop(&mut self) {
    }
}

Compiled with: rustc src\bug.rs, produces the following:

error: internal compiler error: unexpected failure
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 'index out of bounds: the len is 0 but the index is 0', C:\bot\slave\nightly-win\build\src\librustc\lib.rs:1

stack backtrace:
   1: 0x70dc22de
   2: 0x701c9401
   3: 0x701c8f63
   4: 0x701c8d9e
   5: 0x70212848
   6: 0x7021501f
   7: 0x65344bd4
   8: 0x652e560f
   9: 0x652e5150
  10: 0x654661f9
  11: 0x653290b4
  12: 0x654921f9
  13: 0x6542be89
  14: 0x657c3a42
  15: 0x657c5b3a
  16: 0x65b39984
  17: 0x65abda79
  18: 0x65ab81b3
  19: 0x65b5a95c
  20: 0x65b5834d
  21: 0x65b6af0e
  22: 0x65b6ae00
  23: 0x6416fe53
  24: 0x701c8bb5
  25: 0x701c5e03
  26: 0x6416fcfc
  27: 0x701c870f
  28: 0x77849f72

The stack trace is, I admit, not terribly useful. I don't know how to get more information out of it.

If you require any further information, let me know. Happy to help.

@alexcrichton
Copy link
Member

Closing as a dupe of #14889, and moving the test case over to there as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants