Skip to content

ICE: panicked at 'index out of bounds: the len is 2 but the index is 2', compiler/rustc_mir/src/borrow_check/type_check/input_output.rs:76:32 #83499

Closed
@chengniansun

Description

@chengniansun

Code

async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}

Meta

rustc --version --verbose:

rustc 1.53.0-nightly (07e0e2ec2 2021-03-24)
binary: rustc
commit-hash: 07e0e2ec268c140e607e1ac7f49f145612d0f597
commit-date: 2021-03-24
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Error output

error[E0670]: `async fn` is not permitted in Rust 2015
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  | ^^^^^ to use `async fn`, switch to Rust 2018 or later
  |
  = help: set `edition = "2018"` in `Cargo.toml`
  = note: for more on editions, read https://doc.rust-lang.org/edition-guide

error: only foreign or `unsafe extern "C" functions may be C-variadic
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:50
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  |                                                  ^^^

error[E0658]: C-variadic functions are unstable
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #44930 <https://github.com/rust-lang/rust/issues/44930> for more information
  = help: add `#![feature(c_variadic)]` to the crate attributes to enable

error[E0601]: `main` function not found in crate `perses_node_priority_with_dfs_delta_reduced_mutant`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ consider adding a `main` function to `perses_node_priority_with_dfs_delta_reduced_mutant.rs`

error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:55
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  |                                                       ^
  |
note: hidden type `impl Future` captures lifetime smaller than the function body
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:55
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  |                                                       ^

thread 'rustc' panicked at 'index out of bounds: the len is 2 but the index is 2', compiler/rustc_mir/src/borrow_check/type_check/input_output.rs:76:32
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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.53.0-nightly (07e0e2ec2 2021-03-24) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_borrowck] borrow-checking `multiple_named_lifetimes`
#1 [type_of] computing type of `multiple_named_lifetimes::{opaque#0}`
end of query stack
error: aborting due to 5 previous errors

Some errors have detailed explanations: E0601, E0658, E0670, E0700.
For more information about an error, try `rustc --explain E0601`.
Backtrace

error[E0670]: `async fn` is not permitted in Rust 2015
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  | ^^^^^ to use `async fn`, switch to Rust 2018 or later
  |
  = help: set `edition = "2018"` in `Cargo.toml`
  = note: for more on editions, read https://doc.rust-lang.org/edition-guide

error: only foreign or `unsafe extern "C" functions may be C-variadic
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:50
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  |                                                  ^^^

error[E0658]: C-variadic functions are unstable
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #44930 <https://github.com/rust-lang/rust/issues/44930> for more information
  = help: add `#![feature(c_variadic)]` to the crate attributes to enable

error[E0601]: `main` function not found in crate `perses_node_priority_with_dfs_delta_reduced_mutant`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ consider adding a `main` function to `perses_node_priority_with_dfs_delta_reduced_mutant.rs`

error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:55
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  |                                                       ^
  |
note: hidden type `impl Future` captures lifetime smaller than the function body
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:55
  |
1 | async fn multiple_named_lifetimes<'a, 'b>(_: u8, ...) {}
  |                                                       ^

thread 'rustc' panicked at 'index out of bounds: the len is 2 but the index is 2', compiler/rustc_mir/src/borrow_check/type_check/input_output.rs:76:32
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/panicking.rs:92:14
   2: core::panicking::panic_bounds_check
             at /rustc/07e0e2ec268c140e607e1ac7f49f145612d0f597/library/core/src/panicking.rs:69:5
   3: rustc_mir::borrow_check::type_check::type_check
   4: rustc_mir::borrow_check::nll::compute_regions
   5: rustc_mir::borrow_check::do_mir_borrowck
   6: rustc_infer::infer::InferCtxtBuilder::enter
   7: rustc_mir::borrow_check::mir_borrowck
   8: core::ops::function::FnOnce::call_once
   9: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  10: rustc_query_system::query::plumbing::force_query_with_job
  11: rustc_query_system::query::plumbing::get_query_impl
  12: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
  13: rustc_typeck::collect::type_of::type_of
  14: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  15: rustc_data_structures::stack::ensure_sufficient_stack
  16: rustc_query_system::query::plumbing::force_query_with_job
  17: rustc_query_system::query::plumbing::get_query_impl
  18: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::type_of
  19: rustc_typeck::check::check::check_opaque
  20: rustc_typeck::check::check::check_item_type
  21: rustc_middle::hir::map::Map::visit_item_likes_in_module
  22: rustc_typeck::check::check::check_mod_item_types
  23: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  24: rustc_query_system::query::plumbing::force_query_with_job
  25: rustc_query_system::query::plumbing::get_query_impl
  26: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::check_mod_item_types
  27: rustc_session::utils::<impl rustc_session::session::Session>::time
  28: rustc_typeck::check_crate
  29: rustc_interface::passes::analysis
  30: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  31: rustc_data_structures::stack::ensure_sufficient_stack
  32: rustc_query_system::query::plumbing::force_query_with_job
  33: rustc_query_system::query::plumbing::get_query_impl
  34: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  35: rustc_interface::passes::QueryContext::enter
  36: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  37: rustc_span::with_source_map
  38: rustc_interface::interface::create_compiler_and_run
  39: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.53.0-nightly (07e0e2ec2 2021-03-24) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_borrowck] borrow-checking `multiple_named_lifetimes`
#1 [type_of] computing type of `multiple_named_lifetimes::{opaque#0}`
#2 [check_mod_item_types] checking item types in top-level module
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 5 previous errors

Some errors have detailed explanations: E0601, E0658, E0670, E0700.
For more information about an error, try `rustc --explain E0601`.

Metadata

Metadata

Assignees

Labels

A-async-awaitArea: Async & AwaitA-borrow-checkerArea: The borrow checkerAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions