Skip to content

ICE: compiler/rustc_resolve/src/late/lifetimes.rs:2706:32: In fn_like_elision without appropriate scope above #83907

Closed
@chengniansun

Description

@chengniansun

Code

static STATIC_VAR_FIVE: &One();

Meta

rustc --version --verbose:

rustc 1.53.0-nightly (c755ee4ce 2021-04-04)
binary: rustc
commit-hash: c755ee4ce8cae6ea977d65a0288480940db721d9
commit-date: 2021-04-04
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Error output

error: free static item without body
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | static STATIC_VAR_FIVE: &One();
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
  |                               |
  |                               help: provide a definition for the static: `= <expr>;`

error[E0412]: cannot find type `One` in this scope
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:26
  |
1 | static STATIC_VAR_FIVE: &One();
  |                          ^^^ not found in this scope

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 | static STATIC_VAR_FIVE: &One();
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ consider adding a `main` function to `perses_node_priority_with_dfs_delta_reduced_mutant.rs`

error: internal compiler error: compiler/rustc_resolve/src/late/lifetimes.rs:2706:32: In fn_like_elision without appropriate scope above

thread 'rustc' panicked at 'Box<Any>', /rustc/c755ee4ce8cae6ea977d65a0288480940db721d9/library/std/src/panic.rs:59:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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 (c755ee4ce 2021-04-04) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [resolve_lifetimes] resolving lifetimes
#1 [named_region_map] looking up a named region
end of query stack
error: aborting due to 4 previous errors

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

error: free static item without body
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | static STATIC_VAR_FIVE: &One();
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
  |                               |
  |                               help: provide a definition for the static: `= <expr>;`

error[E0412]: cannot find type `One` in this scope
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:26
  |
1 | static STATIC_VAR_FIVE: &One();
  |                          ^^^ not found in this scope

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 | static STATIC_VAR_FIVE: &One();
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ consider adding a `main` function to `perses_node_priority_with_dfs_delta_reduced_mutant.rs`

error: internal compiler error: compiler/rustc_resolve/src/late/lifetimes.rs:2706:32: In fn_like_elision without appropriate scope above

thread 'rustc' panicked at 'Box<Any>', /rustc/c755ee4ce8cae6ea977d65a0288480940db721d9/library/std/src/panic.rs:59:5
stack backtrace:
   0: std::panicking::begin_panic
   1: std::panic::panic_any
   2: rustc_errors::HandlerInner::bug
   3: rustc_errors::Handler::bug
   4: rustc_middle::ty::context::tls::with_opt
   5: rustc_middle::util::bug::opt_span_bug_fmt
   6: rustc_middle::util::bug::bug_fmt
   7: rustc_resolve::late::lifetimes::LifetimeContext::visit_fn_like_elision
   8: <rustc_resolve::late::lifetimes::LifetimeContext as rustc_hir::intravisit::Visitor>::visit_path
   9: <rustc_resolve::late::lifetimes::LifetimeContext as rustc_hir::intravisit::Visitor>::visit_ty
  10: <rustc_resolve::late::lifetimes::LifetimeContext as rustc_hir::intravisit::Visitor>::visit_ty
  11: rustc_hir::intravisit::walk_item
  12: <rustc_resolve::late::lifetimes::LifetimeContext as rustc_hir::intravisit::Visitor>::visit_item
  13: rustc_resolve::late::lifetimes::do_resolve
  14: rustc_resolve::late::lifetimes::resolve_lifetimes
  15: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::resolve_lifetimes>::compute
  16: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  17: rustc_data_structures::stack::ensure_sufficient_stack
  18: rustc_query_system::query::plumbing::force_query_with_job
  19: rustc_query_system::query::plumbing::get_query_impl
  20: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::resolve_lifetimes
  21: rustc_resolve::late::lifetimes::resolve_lifetimes_for
  22: core::ops::function::FnOnce::call_once
  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>::named_region_map
  27: rustc_middle::ty::context::TyCtxt::named_region
  28: <dyn rustc_typeck::astconv::AstConv>::ast_region_to_region
  29: <dyn rustc_typeck::astconv::AstConv>::ast_ty_to_ty_inner
  30: rustc_typeck::collect::type_of::type_of
  31: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  32: rustc_data_structures::stack::ensure_sufficient_stack
  33: rustc_query_system::query::plumbing::force_query_with_job
  34: rustc_query_system::query::plumbing::get_query_impl
  35: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::type_of
  36: rustc_typeck::collect::convert_item
  37: <rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_item
  38: rustc_middle::hir::map::Map::visit_item_likes_in_module
  39: rustc_typeck::collect::collect_mod_item_types
  40: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  41: rustc_query_system::query::plumbing::force_query_with_job
  42: rustc_query_system::query::plumbing::get_query_impl
  43: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::collect_mod_item_types
  44: rustc_session::session::Session::track_errors
  45: rustc_typeck::check_crate
  46: rustc_interface::passes::analysis
  47: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  48: rustc_data_structures::stack::ensure_sufficient_stack
  49: rustc_query_system::query::plumbing::force_query_with_job
  50: rustc_query_system::query::plumbing::get_query_impl
  51: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  52: rustc_interface::passes::QueryContext::enter
  53: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  54: rustc_span::with_source_map
  55: rustc_interface::interface::create_compiler_and_run
  56: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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 (c755ee4ce 2021-04-04) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [resolve_lifetimes] resolving lifetimes
#1 [named_region_map] looking up a named region
#2 [type_of] computing type of `STATIC_VAR_FIVE`
#3 [collect_mod_item_types] collecting item types in top-level module
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors

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

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium 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