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

Compiler panic #40760

Closed
ineiti opened this issue Mar 23, 2017 · 6 comments
Closed

Compiler panic #40760

ineiti opened this issue Mar 23, 2017 · 6 comments
Labels
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

@ineiti
Copy link

ineiti commented Mar 23, 2017

I'm a rust-noob. When compiling my experiments, I get a compiler-panic and it asked me to report here.

I tried this code:

// This probably own't work - I added the "inputs::" myself for reference what is taken below.
pub struct inputs::Element {
    pub source: String,
    pub date: String,
    pub name: String,
}

pub fn new(path: String, inform: Sender<inputs::Element>){
    loop {
        let paths = match fs::read_dir(&path).unwrap(){
            fs::ReadDir(r) => r,
            _ => panic!("Got error while reading {}", &path)
        };

        for p in paths {
            let pa = p.unwrap().path();
            let name = String::from(pa.to_str().unwrap());
            let e = inputs::Element{source: String::from("file:") + &path,
                date: String::from("Constant"), name: name};
            inform.send(e).unwrap();
        }

        thread::sleep(time::Duration::new(1,0));
    }
}

I expected to see this happen: ponies - it compiles!

Instead, this happened:

   Compiling cybermind v0.1.0 (file:///Users/ineiti/IdeaProjects/CyberMind)
     Running `rustc --crate-name cybermind src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=eeee6312c843e5a7 -C extra-filename=-eeee6312c843e5a7 --out-dir /Users/ineiti/IdeaProjects/CyberMind/target/debug/deps -L dependency=/Users/ineiti/IdeaProjects/CyberMind/target/debug/deps`
error: internal compiler error: src/librustc/middle/stability.rs:547: encountered unmarked API
  --> src/inputs/files.rs:16:33
   |
16 |             let pa = p.unwrap().path();
   |                                 ^^^^

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

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:375
note: Run with `RUST_BACKTRACE=1` for a backtrace.

error: Could not compile `cybermind`.

Caused by:
  process didn't exit successfully: `rustc --crate-name cybermind src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=eeee6312c843e5a7 -C extra-filename=-eeee6312c843e5a7 --out-dir /Users/ineiti/IdeaProjects/CyberMind/target/debug/deps -L dependency=/Users/ineiti/IdeaProjects/CyberMind/target/debug/deps` (exit code: 101)

Meta

rustc --version --verbose:

rustc 1.16.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-apple-darwin
release: 1.16.0
LLVM version: 3.9

Backtrace:

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:375
stack backtrace:
   1:        0x10e9bf0cc - std::sys::imp::backtrace::tracing::imp::write::h11f6264c06c3c690
   2:        0x10e9cba2e - std::panicking::default_hook::{{closure}}::hcac54d7a3d5c4b83
   3:        0x10e9cb5d3 - std::panicking::default_hook::h5b17330436c00b98
   4:        0x10e9cbee7 - std::panicking::rust_panic_with_hook::h715d6f06ce39d1b2
   5:        0x10be2bd1b - std::panicking::begin_panic::h6a48cb4b1a8bf951
   6:        0x10bfd95a3 - rustc::session::opt_span_bug_fmt::{{closure}}::h80ebd6c236885f5d
   7:        0x10bfd93f9 - rustc::session::opt_span_bug_fmt::hd7f34411b6a25c2f
   8:        0x10bfd9207 - rustc::session::span_bug_fmt::hdfe86a9067534e75
   9:        0x10bfb49d8 - rustc::middle::stability::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::check_stability::hceb9b9cca27cc17f
  10:        0x10b2946c2 - rustc_typeck::check::method::<impl rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx>>::lookup_method::hf91914e563f8efe7
  11:        0x10b2e0737 - rustc_typeck::check::FnCtxt::check_expr_kind::h62c70b8e8b437560
  12:        0x10b2ddded - rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref::hca6b8e27e1ae0714
  13:        0x10b2eec27 - rustc_typeck::check::FnCtxt::check_decl_initializer::h28040fc7cd58838a
  14:        0x10b2eed2d - rustc_typeck::check::FnCtxt::check_decl_local::hfff6384269570989
  15:        0x10b2ef066 - rustc_typeck::check::FnCtxt::check_stmt::h7a9d4f0ec3b2a971
  16:        0x10b2ef3ce - rustc_typeck::check::FnCtxt::check_block_with_expected::h953c0a2c08f0272b
  17:        0x10b2de2a4 - rustc_typeck::check::FnCtxt::check_expr_kind::h62c70b8e8b437560
  18:        0x10b2ddded - rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref::hca6b8e27e1ae0714
  19:        0x10b267e50 - rustc_typeck::check::_match::<impl rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx>>::check_match::hb4f662d23ea82672
  20:        0x10b2de5b6 - rustc_typeck::check::FnCtxt::check_expr_kind::h62c70b8e8b437560
  21:        0x10b2ddded - rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref::hca6b8e27e1ae0714
  22:        0x10b2ef40e - rustc_typeck::check::FnCtxt::check_block_with_expected::h953c0a2c08f0272b
  23:        0x10b2de450 - rustc_typeck::check::FnCtxt::check_expr_kind::h62c70b8e8b437560
  24:        0x10b2ddded - rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref::hca6b8e27e1ae0714
  25:        0x10b267e50 - rustc_typeck::check::_match::<impl rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx>>::check_match::hb4f662d23ea82672
  26:        0x10b2de5b6 - rustc_typeck::check::FnCtxt::check_expr_kind::h62c70b8e8b437560
  27:        0x10b2ddded - rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref::hca6b8e27e1ae0714
  28:        0x10b2eec27 - rustc_typeck::check::FnCtxt::check_decl_initializer::h28040fc7cd58838a
  29:        0x10b2eed2d - rustc_typeck::check::FnCtxt::check_decl_local::hfff6384269570989
  30:        0x10b2ef066 - rustc_typeck::check::FnCtxt::check_stmt::h7a9d4f0ec3b2a971
  31:        0x10b2ef3ce - rustc_typeck::check::FnCtxt::check_block_with_expected::h953c0a2c08f0272b
  32:        0x10b2de2a4 - rustc_typeck::check::FnCtxt::check_expr_kind::h62c70b8e8b437560
  33:        0x10b2ddded - rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref::hca6b8e27e1ae0714
  34:        0x10b2ef000 - rustc_typeck::check::FnCtxt::check_stmt::h7a9d4f0ec3b2a971
  35:        0x10b2ef3ce - rustc_typeck::check::FnCtxt::check_block_with_expected::h953c0a2c08f0272b
  36:        0x10b2de450 - rustc_typeck::check::FnCtxt::check_expr_kind::h62c70b8e8b437560
  37:        0x10b2ddded - rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref::hca6b8e27e1ae0714
  38:        0x10b2ef40e - rustc_typeck::check::FnCtxt::check_block_with_expected::h953c0a2c08f0272b
  39:        0x10b2de2a4 - rustc_typeck::check::FnCtxt::check_expr_kind::h62c70b8e8b437560
  40:        0x10b2ddded - rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref::hca6b8e27e1ae0714
  41:        0x10b2c4fd4 - rustc_typeck::check::check_fn::hcd7f2f03085c6497
  42:        0x10b2c3fde - rustc_typeck::check::check_bare_fn::hb58864524100eeaf
  43:        0x10b2c17ca - rustc_typeck::check::check_item_bodies::hb7db7fdf60331b5f
  44:        0x10b32ca64 - rustc_typeck::check_crate::h688f35d2b29429e7
  45:        0x10aefd040 - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::hfe04819b98fd637c
  46:        0x10aee9717 - rustc_driver::driver::phase_3_run_analysis_passes::he434e73ce659d302
  47:        0x10aeced20 - rustc_driver::driver::compile_input::hafc1bdff3e824474
  48:        0x10af1671e - rustc_driver::run_compiler::h28dd1122848b0db9
  49:        0x10ae2e288 - std::panicking::try::do_call::he3322c3e215f35d0
  50:        0x10e9ceafa - __rust_maybe_catch_panic
  51:        0x10ae56ba3 - <F as alloc::boxed::FnBox<A>>::call_box::hb607dad48bf6d166
  52:        0x10e9cab54 - std::sys::imp::thread::Thread::new::thread_start::h598266263fa7f71c
  53:     0x7fff879bb99c - _pthread_body
  54:     0x7fff879bb919 - _pthread_start
@oli-obk
Copy link
Contributor

oli-obk commented Mar 23, 2017

playground repro: https://is.gd/ZzaGoO

@ineiti
Copy link
Author

ineiti commented Mar 23, 2017

Shortest I found: https://is.gd/KMXbtw

@eddyb eddyb added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 13, 2017
@eddyb
Copy link
Member

eddyb commented Apr 13, 2017

I found this by looking for an issue that would describe https://is.gd/ISFv9x.
cc @rust-lang/compiler @petrochenkov

@petrochenkov
Copy link
Contributor

Duplcate of #38857

@nikomatsakis
Copy link
Contributor

Should we close this as a duplicate then? @eddyb, I see you nominated...?

@eddyb
Copy link
Member

eddyb commented Apr 13, 2017

Ah sure. I just couldn't find the original.

@eddyb eddyb closed this as completed Apr 13, 2017
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) ❄️ 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

5 participants