Skip to content

compiler panic on bad negative bound #58857

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
nakacristo opened this issue Mar 1, 2019 · 3 comments
Closed

compiler panic on bad negative bound #58857

nakacristo opened this issue Mar 1, 2019 · 3 comments
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@nakacristo
Copy link

This simple incorrect code makes the compiler to panic.

impl<A:!Valid> Conj{}

Bug on beta version. The stable version shows correctly a syntactic error.

Compiling playground v0.0.1 (/playground)
thread 'rustc' panicked at 'called Option::unwrap() on a None value', src/libcore/option.rs:345:21
note: Run with RUST_BACKTRACE=1 environment variable to display a 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.34.0-beta.1 (744b374 2019-02-26) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type lib

backtrace:

Standard Error

   Compiling playground v0.0.1 (/playground)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:345:21
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:70
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:215
   4: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:478
   5: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:385
   6: rust_begin_unwind
             at src/libstd/panicking.rs:312
   7: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
   8: core::panicking::panic
             at src/libcore/panicking.rs:49
   9: syntax::parse::parser::Parser::parse_generic_bounds_common
  10: syntax::parse::parser::Parser::parse_generic_params
  11: syntax::parse::parser::Parser::parse_generics
  12: syntax::parse::parser::Parser::parse_item_implementation
  13: syntax::parse::parser::Parser::parse_item_
  14: syntax::parse::parser::Parser::parse_item
  15: syntax::parse::parser::Parser::parse_mod_items
  16: syntax::parse::parser::Parser::parse_crate_mod
  17: syntax::parse::parse_crate_from_file
  18: rustc_driver::driver::phase_1_parse_input::{{closure}}
  19: rustc::util::common::time
  20: rustc_driver::driver::phase_1_parse_input
  21: rustc_driver::driver::compile_input
  22: rustc_driver::run_compiler_with_pool
  23: <scoped_tls::ScopedKey<T>>::set
  24: rustc_driver::run_compiler
  25: syntax::with_globals
  26: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:87
  27: <F as alloc::boxed::FnBox<A>>::call_box
  28: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/744b374ab6197d7d06994b06a9598bbd3210efce/src/liballoc/boxed.rs:759
             at src/libstd/sys_common/thread.rs:14
             at src/libstd/sys/unix/thread.rs:81
  29: start_thread
  30: __clone
@jonas-schievink jonas-schievink 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. regression-from-stable-to-beta Performance or correctness regression from stable to beta. C-bug Category: This is a bug. labels Mar 1, 2019
@petrochenkov
Copy link
Contributor

cc @hdhoang @estebank
This looks like a "diagnostic improvement".

@estebank
Copy link
Contributor

estebank commented Mar 1, 2019

I missed the unwrap in that PR.

@pnkfelix
Copy link
Member

pnkfelix commented Mar 7, 2019

triage: P-high. Assigning @estebank

@pnkfelix pnkfelix added the P-high High priority label Mar 7, 2019
pietroalbini added a commit to pietroalbini/rust that referenced this issue Mar 8, 2019
…rochenkov

Expand where negative supertrait specific error is shown

Fix rust-lang#58857.

r? @petrochenkov
pietroalbini pushed a commit to pietroalbini/rust that referenced this issue Mar 16, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. 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