Skip to content

compiler panic on bad negative bound #58857

Closed
@nakacristo

Description

@nakacristo

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

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions