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

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`.

Activity

  1. added
    C-bugCategory: This is a bug.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Mar 25, 2021
  2. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Mar 25, 2021
  3. apiraino commented on Mar 26, 2021

    @apiraino
    Contributor

    I've tried bisecting, could only pinpoint a range of merged PRs

    ********************************************************************************
    Regression in nightly-2020-03-25
    ********************************************************************************
    ...
    found 8 bors merge commits in the specified range
      commit[0] 2020-03-23UTC: Auto merge of #70330 - Centril:rollup-ts0clvx, r=Centril
      commit[1] 2020-03-23UTC: Auto merge of #70322 - matthiaskrgr:submodule_upd, r=Dylan-DPC
      commit[2] 2020-03-24UTC: Auto merge of #70343 - Centril:rollup-94egfvs, r=Centril
      commit[3] 2020-03-24UTC: Auto merge of #70351 - Centril:rollup-tveoq3w, r=Centril
      commit[4] 2020-03-24UTC: Auto merge of #69894 - vtbassmatt:master, r=nellshamrell
      commit[5] 2020-03-24UTC: Auto merge of #70163 - nikic:llvm-10-preparation, r=cuviper
      commit[6] 2020-03-24UTC: Auto merge of #70190 - pietroalbini:gha, r=Mark-Simulacrum
      commit[7] 2020-03-24UTC: Auto merge of #70371 - Centril:rollup-ywi1vo3, r=Centril
    ERROR: no commits between 1edd389cc4c7b5be7a3dd4fe4b986f6017018e54 and 02046a5d402c789c006d0da7662f800fe3c45faf within last 167 days
    
  4. added a commit that references this issue on Mar 26, 2021
  5. nikomatsakis commented on Mar 26, 2021

    @nikomatsakis
    Contributor

    Probably we just need to break out from this loop if argument_index >= body.local_decls.len():

    // Equate expected input tys with those in the MIR.
    for (argument_index, &normalized_input_ty) in normalized_input_tys.iter().enumerate() {
    // In MIR, argument N is stored in local N+1.
    let local = Local::new(argument_index + 1);
    let mir_input_ty = body.local_decls[local].ty;
    let mir_input_span = body.local_decls[local].source_info.span;
    self.equate_normalized_input_or_output(
    normalized_input_ty,
    mir_input_ty,
    mir_input_span,
    );
    }

    In that case, we should include a delay_span_bug call before we break as well

  6. added
    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.
    AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.
    on Mar 26, 2021
  7. MidasLamb commented on Mar 26, 2021

    @MidasLamb
    Contributor

    @rustbot claim

  8. chengniansun commented on Mar 27, 2021

    @chengniansun
    Author

    A duplicate.

    fn foo(_: usize, ap0: VaListImpl, ...) -> impl {}
  9. apiraino commented on Mar 31, 2021

    @apiraino
    Contributor

    Assigning priority as discussed as part of the Prioritization Working Group procedure and removing I-prioritize.

    @rustbot label -I-prioritize +P-low

  10. added
    P-lowLow priority
    and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Mar 31, 2021
  11. added a commit that references this issue on Apr 1, 2021
    d101414
  12. added 3 commits that reference this issue on Apr 2, 2021
    bf384b6
    9613582
    03ba8ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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