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

unexpected panic #47758

Closed
d653 opened this issue Jan 25, 2018 · 2 comments
Closed

unexpected panic #47758

d653 opened this issue Jan 25, 2018 · 2 comments
Labels
A-borrow-checker Area: The borrow checker A-coroutines Area: Coroutines C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@d653
Copy link

d653 commented Jan 25, 2018

I tried this code:

#![feature(proc_macro, conservative_impl_trait, generators)]
extern crate futures_await as futures;
use futures::future::ok;
use futures::prelude::*;

enum Test{
    A(i32),
    B
}

fn main() {}

#[async]
fn fun(test : Test) -> Result<(),()> {

    if let Test::A(ref _a) = test {
         await!(ok::<(), ()>(()));
    }

    Ok(())
}

Cargo.toml:

[package]
name = "rustcrash"
version = "0.1.0"
authors = ["me"]

[dependencies]
futures-await = "0.1"

This happened:

$ RUST_BACKTRACE=1 cargo build --verbose
       Fresh futures v0.1.18
       Fresh unicode-xid v0.1.0
       Fresh futures-await-await-macro v0.1.0
       Fresh proc-macro2 v0.1.10
       Fresh futures-await-quote v0.4.0
       Fresh futures-await-synom v0.12.0
       Fresh futures-await-syn v0.12.0
       Fresh futures-await-async-macro v0.1.1
       Fresh futures-await v0.1.0
   Compiling rustcrash v0.1.0 (file:///home/me/sources/rustcrash)
     Running `rustc --crate-name rustcrash src/main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=d36b845e11bcd35d -C extra-filename=-d36b845e11bcd35d --out-dir /home/me/sources/rustcrash/target/debug/deps -C incremental=/home/me/sources/rustcrash/target/debug/incremental -L dependency=/home/me/sources/rustcrash/target/debug/deps --extern futures_await=/home/me/sources/rustcrash/target/debug/deps/libfutures_await-cf8240b5fc65c835.rlib`
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: rustc 1.25.0-nightly (a0dcecff9 2018-01-24) running on x86_64-unknown-linux-gnu

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:335:21
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:68
             at libstd/sys_common/backtrace.rs:57
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:380
   3: std::panicking::default_hook
             at libstd/panicking.rs:390
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:576
   5: std::panicking::begin_panic
             at libstd/panicking.rs:537
   6: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:521
   7: rust_begin_unwind
             at libstd/panicking.rs:497
   8: core::panicking::panic_fmt
             at libcore/panicking.rs:71
   9: core::panicking::panic
             at libcore/panicking.rs:51
  10: rustc::middle::region::ScopeTree::yield_in_scope_for_expr
  11: <rustc_borrowck::borrowck::check_loans::CheckLoanCtxt<'a, 'tcx> as rustc::middle::expr_use_visitor::Delegate<'tcx>>::borrow
  12: rustc::middle::mem_categorization::MemCategorizationContext::cat_pattern_
  13: rustc::middle::mem_categorization::MemCategorizationContext::cat_pattern_
  14: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_pat
  15: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  16: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  17: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  18: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_local
  19: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  20: rustc_borrowck::borrowck::check_loans::check_loans
  21: rustc_borrowck::borrowck::borrowck
  22: rustc::dep_graph::graph::DepGraph::with_task_impl
  23: rustc_errors::Handler::track_diagnostics
  24: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  25: rustc::ty::maps::<impl rustc::ty::maps::queries::borrowck<'tcx>>::force
  26: rustc::ty::maps::<impl rustc::ty::maps::queries::borrowck<'tcx>>::try_get
  27: rustc::ty::maps::TyCtxtAt::borrowck
  28: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::borrowck
  29: rustc_borrowck::borrowck::check_crate
  30: <std::thread::local::LocalKey<T>>::with
  31: <std::thread::local::LocalKey<T>>::with
  32: rustc_driver::driver::compile_input
  33: rustc_driver::run_compiler

error: Could not compile `rustcrash`.

Caused by:
  process didn't exit successfully: `rustc --crate-name rustcrash src/main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=d36b845e11bcd35d -C extra-filename=-d36b845e11bcd35d --out-dir /home/me/sources/rustcrash/target/debug/deps -C incremental=/home/me/sources/rustcrash/target/debug/incremental -L dependency=/home/me/sources/rustcrash/target/debug/deps --extern futures_await=/home/me/sources/rustcrash/target/debug/deps/libfutures_await-cf8240b5fc65c835.rlib` (exit code: 101)

@pietroalbini pietroalbini added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-borrow-checker Area: The borrow checker A-coroutines Area: Coroutines labels Jan 25, 2018
@bbigras
Copy link

bbigras commented Jan 26, 2018

I have a similar backtrace:

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: rustc 1.25.0-nightly (a0dcecff9 2018-01-24) running on x86_64-unknown-linux-gnu

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:335:21
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:68
             at libstd/sys_common/backtrace.rs:57
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:380
   3: std::panicking::default_hook
             at libstd/panicking.rs:390
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:576
   5: std::panicking::begin_panic
             at libstd/panicking.rs:537
   6: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:521
   7: rust_begin_unwind
             at libstd/panicking.rs:497
   8: core::panicking::panic_fmt
             at libcore/panicking.rs:71
   9: core::panicking::panic
             at libcore/panicking.rs:51
  10: rustc::middle::region::ScopeTree::yield_in_scope_for_expr
  11: <rustc_borrowck::borrowck::check_loans::CheckLoanCtxt<'a, 'tcx> as rustc::middle::expr_use_visitor::Delegate<'tcx>>::borrow
  12: rustc::middle::mem_categorization::MemCategorizationContext::cat_pattern_
  13: rustc::middle::mem_categorization::MemCategorizationContext::cat_pattern_
  14: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_pat
  15: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  16: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_local
  17: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  18: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  19: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_local
  20: rustc::middle::expr_use_visitor::ExprUseVisitor::walk_expr
  21: rustc_borrowck::borrowck::check_loans::check_loans
  22: rustc_borrowck::borrowck::borrowck
  23: rustc::dep_graph::graph::DepGraph::with_task_impl
  24: rustc_errors::Handler::track_diagnostics
  25: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  26: rustc::ty::maps::<impl rustc::ty::maps::queries::borrowck<'tcx>>::force
  27: rustc::ty::maps::<impl rustc::ty::maps::queries::borrowck<'tcx>>::try_get
  28: rustc::ty::maps::TyCtxtAt::borrowck
  29: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::borrowck
  30: rustc_borrowck::borrowck::check_crate
  31: <std::thread::local::LocalKey<T>>::with
  32: <std::thread::local::LocalKey<T>>::with
  33: rustc_driver::driver::compile_input
  34: rustc_driver::run_compiler

@d653
Copy link
Author

d653 commented Jan 27, 2018

Shorter code that triggers the bug:

#![feature(generators)]

enum Test{
    A(i32),
    B
}

fn main() {
    let test = Test::A(0);
    let _ = move || {
        if let Test::A(ref _a) = test {
            yield 0;
        }
    };
}

@bors bors closed this as completed in dd3fa07 Feb 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-borrow-checker Area: The borrow checker A-coroutines Area: Coroutines C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants