Skip to content

Panic in nightly rustc_errors::CodeSuggestion::splice_lines #57521

Closed
@NickFinco

Description

@NickFinco

Full source file:
fn x<T, '_, 'b>() {}

Panic output:

x@y.z:~/repro$ RUST_BACKTRACE=full cargo build
   Compiling repro v0.1.0 (/home/x/repro)
error: lifetime parameters must be declared prior to type parameters
 --> src/lib.rs:1:9
  |
1 | fn x<T, '_, 'b>() {}
  |         ^^  ^^
thread 'rustc' panicked at 'begin <= end (12 <= 10) when slicing `fn x<T, '_, 'b>() {}`', src/libcore/str/mod.rs:2085:5
stack backtrace:
   0:     0x7f3e690d9643 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h150bfa0663b43d9c
                               at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1:     0x7f3e690d1ca8 - std::sys_common::backtrace::_print::haf67371a49a69611
                               at src/libstd/sys_common/backtrace.rs:70
   2:     0x7f3e690d57d2 - std::panicking::default_hook::{{closure}}::hfc43ed4580f31f37
                               at src/libstd/sys_common/backtrace.rs:58
                               at src/libstd/panicking.rs:200
   3:     0x7f3e690d5544 - std::panicking::default_hook::h9b7f9ea5176f68e5
                               at src/libstd/panicking.rs:215
   4:     0x7f3e690d5ee0 - std::panicking::rust_panic_with_hook::h71fb7e2d0df54e52
                               at src/libstd/panicking.rs:478
   5:     0x7f3e690d5a61 - std::panicking::continue_panic_fmt::h7e9d5b7aec3fd429
                               at src/libstd/panicking.rs:385
   6:     0x7f3e690d5945 - rust_begin_unwind
                               at src/libstd/panicking.rs:312
   7:     0x7f3e690ffc7c - core::panicking::panic_fmt::h77387da9b048cc4b
                               at src/libcore/panicking.rs:85
   8:     0x7f3e691021ed - core::str::slice_error_fail::h368eecf1ba87bfe3
                               at src/libcore/str/mod.rs:0
   9:     0x7f3e639f5fc1 - core::str::traits::<impl core::slice::SliceIndex<str> for core::ops::range::Range<usize>>::index::{{closure}}::h70438d1d5e25fc9e
  10:     0x7f3e639f66d9 - rustc_errors::CodeSuggestion::splice_lines::push_trailing::hbf8e90335f4e2bb1
  11:     0x7f3e639db7d5 - <core::iter::Map<I, F> as core::iter::iterator::Iterator>::fold::h67192288499ae88c
  12:     0x7f3e639e9255 - <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter::h43c363b3f75ad1ab
  13:     0x7f3e639cf31f - <rustc_errors::emitter::EmitterWriter as rustc_errors::emitter::Emitter>::emit::h8853175141876d04
  14:     0x7f3e639f8ef3 - rustc_errors::Handler::emit_db::h421840da2bbe513f
  15:     0x7f3e639e3137 - rustc_errors::diagnostic_builder::DiagnosticBuilder::emit::he5215c099ff8cf17
  16:     0x7f3e63cfbb96 - syntax::parse::parser::Parser::parse_generic_params::hd5de9a47f6fadd18
  17:     0x7f3e63cfc8cc - syntax::parse::parser::Parser::parse_generics::h1e95f88cfb3ffee6
  18:     0x7f3e63d01422 - syntax::parse::parser::Parser::parse_item_fn::h7c9b251954586049
  19:     0x7f3e63d10bc1 - syntax::parse::parser::Parser::parse_item_implementation::h7f6fdd21562dab35
  20:     0x7f3e63d0e2e3 - syntax::parse::parser::Parser::parse_item_::hf7a2db2c185b3b7c
  21:     0x7f3e63d24039 - syntax::parse::parser::Parser::parse_item::h73139576d53e3863
  22:     0x7f3e63d0b7e0 - syntax::parse::parser::Parser::parse_mod_items::hfdc10792132eab23
  23:     0x7f3e63d24d46 - syntax::parse::parser::Parser::parse_crate_mod::h2c19d9f9e4e17439
  24:     0x7f3e63de0a88 - syntax::parse::parse_crate_from_file::h20069ccc4bc2b875
  25:     0x7f3e69446c8b - rustc_driver::driver::phase_1_parse_input::{{closure}}::ha4e265e108e0b04a
  26:     0x7f3e694467be - rustc_driver::driver::phase_1_parse_input::hb92f841897290bd6
  27:     0x7f3e6943f27b - rustc_driver::driver::compile_input::h0205d11fa4255421
  28:     0x7f3e693ceb30 - rustc_driver::run_compiler_with_pool::hdb7366dec3b2aedf
  29:     0x7f3e693d9ff5 - <scoped_tls::ScopedKey<T>>::set::hc8c0a4e63f3470da
  30:     0x7f3e693cd97a - rustc_driver::run_compiler::he1ef103f381b0a7a
  31:     0x7f3e693d99ea - <scoped_tls::ScopedKey<T>>::set::h9a000850eb3d4fe8
  32:     0x7f3e694acbe2 - std::sys_common::backtrace::__rust_begin_short_backtrace::he0524e22fe3ddb41
  33:     0x7f3e690e7569 - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:92
  34:     0x7f3e694b8260 - <F as alloc::boxed::FnBox<A>>::call_box::h04932c55efd4205e
  35:     0x7f3e690e632d - std::sys::unix::thread::Thread::new::thread_start::h3de0150320ce4b08
                               at /rustc/c2d381d39d282c0586d50ea7d7a431ffd5ddb3fb/src/liballoc/boxed.rs:744
                               at src/libstd/sys_common/thread.rs:14
                               at src/libstd/sys/unix/thread.rs:81
  36:     0x7f3e68e5b493 - start_thread
  37:     0x7f3e68791a8e - __clone
  38:                0x0 - <unknown>

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.33.0-nightly (c2d381d39 2019-01-10) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `repro`.

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsI-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