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: cat_expr Errd #24013

Closed
dovahcrow opened this issue Apr 3, 2015 · 0 comments · Fixed by #24367
Closed

ICE: cat_expr Errd #24013

dovahcrow opened this issue Apr 3, 2015 · 0 comments · Fixed by #24367
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@dovahcrow
Copy link
Contributor

maybe a bug in type inference?

I tried this code:

fn main() {
    use std::mem::*;
    let a = 1;
    let b = 2;
    unsafe {swap::<&mut _>(transmute(&a), transmute(&b))};
}

and playpen

Meta

rustc --version --verbose:

rustc 1.0.0-nightly (d17d6e7f1 2015-04-02) (built 2015-04-03)
binary: rustc
commit-hash: d17d6e7f1f05fbdd4d9d246400ffebf768878c7a
commit-date: 2015-04-02
build-date: 2015-04-03
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly

Backtrace:

thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:130

stack backtrace:
   1:     0x7faee32be3b8 - sys::backtrace::write::he4dda5a986f8dfc9IJC
   2:     0x7faee32e9760 - panicking::on_panic::h5b2db6d96c6af729sXI
   3:     0x7faee3221493 - rt::unwind::begin_unwind_inner::h312dab2a9cc03afbACI
   4:     0x7faee05e705d - rt::unwind::begin_unwind::h8552855983279226119
   5:     0x7faee05e7003 - diagnostic::SpanHandler::span_bug::h047bbb0d01e0a28bjnB
   6:     0x7faee0e88b53 - session::Session::span_bug::h8e85b4257a239e266Xq
   7:     0x7faee1f4acad - check::regionck::visit_expr::ha7a7caa6308adb39PJd
   8:     0x7faee1f5327e - visit::walk_expr::h7711135408040361563
   9:     0x7faee1f4a522 - check::regionck::visit_expr::ha7a7caa6308adb39PJd
  10:     0x7faee1f536f8 - visit::walk_expr::h7711135408040361563
  11:     0x7faee1f4a059 - check::regionck::visit_expr::ha7a7caa6308adb39PJd
  12:     0x7faee1f49920 - check::regionck::visit_expr::ha7a7caa6308adb39PJd
  13:     0x7faee1f4a059 - check::regionck::visit_expr::ha7a7caa6308adb39PJd
  14:     0x7faee1f5367d - visit::walk_expr::h7711135408040361563
  15:     0x7faee1f49c31 - check::regionck::visit_expr::ha7a7caa6308adb39PJd
  16:     0x7faee1f49983 - check::regionck::visit_expr::ha7a7caa6308adb39PJd
  17:     0x7faee1f5367d - visit::walk_expr::h7711135408040361563
  18:     0x7faee1f49c31 - check::regionck::visit_expr::ha7a7caa6308adb39PJd
  19:     0x7faee1f4b7da - check::regionck::visit_local::h1d3e9df070391b34UGd
  20:     0x7faee1f53710 - visit::walk_expr::h7711135408040361563
  21:     0x7faee1f4a059 - check::regionck::visit_expr::ha7a7caa6308adb39PJd
  22:     0x7faee1f45ccf - check::regionck::Rcx<'a, 'tcx>::visit_fn_body::he16da04e9c53d9f6amd
  23:     0x7faee1fe0b31 - check::check_bare_fn::h4ed57fcdf8abf23cUQn
  24:     0x7faee1fda614 - check::check_item::h66f023fd6d694e3fF9n
  25:     0x7faee1fded52 - visit::walk_item::h16105192910878993865
  26:     0x7faee1fded5d - visit::walk_item::h16105192910878993865
  27:     0x7faee20b2a41 - check_crate::closure.36300
  28:     0x7faee20ace13 - check_crate::ha6e679122aa8dfb5bwC
  29:     0x7faee393e5cd - driver::phase_3_run_analysis_passes::h001143095bbfc525gGa
  30:     0x7faee3922425 - driver::compile_input::h982ca27ddfea1322Qba
  31:     0x7faee39d99d5 - run_compiler::h46e3b1adb4d7a56fV4b
  32:     0x7faee39d72ed - boxed::F.FnBox<A>::call_box::h10231365352816203841
  33:     0x7faee39d6829 - rt::unwind::try::try_fn::h6438714248533661505
  34:     0x7faee3365c58 - rust_try_inner
  35:     0x7faee3365c45 - rust_try
  36:     0x7faee39d6afb - boxed::F.FnBox<A>::call_box::h8924274584753923957
  37:     0x7faee32d4771 - sys::thread::create::thread_start::h1fdda6dc8c80280aExH
  38:     0x7faedd0c5373 - start_thread
  39:     0x7faee2e9427c - __clone
  40:                0x0 - <unknown>
@pnkfelix pnkfelix added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Apr 3, 2015
ebfull added a commit to ebfull/rust that referenced this issue Apr 13, 2015
An actual typeck error is the cause of many failed compilations but an
unrelated bug is being reported instead. It is triggered because a typeck
error is presumably not yet identified during compiler execution, which
would normally bypass an invariant in the presence of other errors. In
this particular situation, we delay the reporting of the bug until
abort_if_errors().

Closes rust-lang#23827, closes rust-lang#24356, closes rust-lang#23041, closes rust-lang#22897, closes rust-lang#23966,
closes rust-lang#24013, and closes rust-lang#23729
bors added a commit that referenced this issue Apr 26, 2015
An actual typeck error is the cause of many failed compilations but an
unrelated bug is being reported instead. It is triggered because a typeck
error is presumably not yet identified during compiler execution, which
would normally bypass an invariant in the presence of other errors. In
this particular situation, we delay the reporting of the bug until
abort_if_errors().

Closes #23827, closes #24356, closes #23041, closes #22897, closes #23966,
closes #24013, and closes #23729

**There is at least one situation where this bug may still be genuinely
triggered (#23437).**
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

Successfully merging a pull request may close this issue.

2 participants