Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler/rustc_hir_analysis/src/check/wfcheck.rs:1582:26: unexpected region: ReStatic #112094

Closed
NightEule5 opened this issue May 30, 2023 · 2 comments · Fixed by #113036
Closed
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@NightEule5
Copy link

NightEule5 commented May 30, 2023

Code

#![allow(incomplete_features)]
#![feature(adt_const_params, return_position_impl_trait_in_trait)]

pub struct Element;

pub trait Node {
    fn elements<const T: &'static str>(&self) -> impl Iterator<Item = Element>;
}

Meta

rustc --version --verbose:

rustc 1.72.0-nightly (498553fc0 2023-05-29)
binary: rustc
commit-hash: 498553fc04f6a3fdc53412320f4e913bc53bc267
commit-date: 2023-05-29
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.4

Error output

error: internal compiler error: compiler/rustc_hir_analysis/src/check/wfcheck.rs:1582:26: unexpected region: ReStatic

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/498553fc04f6a3fdc53412320f4e913bc53bc267/compiler/rustc_errors/src/lib.rs:1651:9
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::HandlerInner>::bug::<alloc::string::String>
   2: <rustc_errors::Handler>::bug::<alloc::string::String>
   3: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   5: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   6: rustc_middle::util::bug::bug_fmt
   7: <rustc_hir_analysis::check::wfcheck::ImplTraitInTraitFinder as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty::{closure#0}
   8: <rustc_middle::ty::Ty as rustc_type_ir::fold::TypeSuperFoldable<rustc_middle::ty::context::TyCtxt>>::super_fold_with::<rustc_middle::ty::fold::RegionFolder>
   9: <rustc_middle::ty::consts::Const as rustc_type_ir::fold::TypeSuperFoldable<rustc_middle::ty::context::TyCtxt>>::super_fold_with::<rustc_middle::ty::fold::RegionFolder>
  10: <&rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_middle::ty::fold::RegionFolder>
  11: <rustc_middle::ty::sty::AliasTy as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_middle::ty::fold::RegionFolder>
  12: <rustc_middle::ty::context::TyCtxt>::fold_regions::<rustc_middle::ty::sty::AliasTy, <rustc_hir_analysis::check::wfcheck::ImplTraitInTraitFinder as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty::{closure#0}>
  13: <rustc_hir_analysis::check::wfcheck::ImplTraitInTraitFinder as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
  14: rustc_hir_analysis::check::wfcheck::check_fn_or_method
  15: rustc_hir_analysis::check::wfcheck::check_associated_item
  16: rustc_hir_analysis::check::wfcheck::check_well_formed
  17: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::par_for_each_in<&[rustc_hir::hir_id::OwnerId], <rustc_middle::hir::map::Map>::par_for_each_module<rustc_hir_analysis::check_crate::{closure#5}::{closure#0}::{closure#0}>::{closure#0}>::{closure#0}::{closure#0}>>
  18: rustc_data_structures::sync::par_for_each_in::<&[rustc_hir::hir_id::OwnerId], <rustc_middle::hir::map::Map>::par_for_each_module<rustc_hir_analysis::check_crate::{closure#5}::{closure#0}::{closure#0}>::{closure#0}>
  19: <rustc_session::session::Session>::track_errors::<rustc_hir_analysis::check_crate::{closure#5}, ()>
  20: rustc_hir_analysis::check_crate
  21: rustc_interface::passes::analysis
  22: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
  23: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
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.72.0-nightly (498553fc0 2023-05-29) running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [check_well_formed] checking that `Node::elements` is well-formed
#1 [analysis] running analysis passes on this crate
end of query stack
there was a panic while trying to force a dep node
try_mark_green dep node stack:
#0 check_mod_type_wf(ice_test[2ea4])
end of try_mark_green dep node stack
Backtrace

stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::HandlerInner>::bug::<alloc::string::String>
   2: <rustc_errors::Handler>::bug::<alloc::string::String>
   3: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   5: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   6: rustc_middle::util::bug::bug_fmt
   7: <rustc_hir_analysis::check::wfcheck::ImplTraitInTraitFinder as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty::{closure#0}
   8: <rustc_middle::ty::Ty as rustc_type_ir::fold::TypeSuperFoldable<rustc_middle::ty::context::TyCtxt>>::super_fold_with::<rustc_middle::ty::fold::RegionFolder>
   9: <rustc_middle::ty::consts::Const as rustc_type_ir::fold::TypeSuperFoldable<rustc_middle::ty::context::TyCtxt>>::super_fold_with::<rustc_middle::ty::fold::RegionFolder>
  10: <&rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_middle::ty::fold::RegionFolder>
  11: <rustc_middle::ty::sty::AliasTy as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_middle::ty::fold::RegionFolder>
  12: <rustc_middle::ty::context::TyCtxt>::fold_regions::<rustc_middle::ty::sty::AliasTy, <rustc_hir_analysis::check::wfcheck::ImplTraitInTraitFinder as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty::{closure#0}>
  13: <rustc_hir_analysis::check::wfcheck::ImplTraitInTraitFinder as rustc_type_ir::visit::TypeVisitor<rustc_middle::ty::context::TyCtxt>>::visit_ty
  14: rustc_hir_analysis::check::wfcheck::check_fn_or_method
  15: rustc_hir_analysis::check::wfcheck::check_associated_item
  16: rustc_hir_analysis::check::wfcheck::check_well_formed
  17: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::par_for_each_in<&[rustc_hir::hir::ForeignItemId], <rustc_middle::hir::ModuleItems>::par_foreign_items<rustc_hir_analysis::check::wfcheck::check_mod_type_wf::{closure#3}>::{closure#0}>::{closure#0}::{closure#0}>>
  18: rustc_data_structures::sync::par_for_each_in::<&[rustc_hir::hir::TraitItemId], <rustc_middle::hir::ModuleItems>::par_trait_items<rustc_hir_analysis::check::wfcheck::check_mod_type_wf::{closure#2}>::{closure#0}>
  19: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
  20: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::par_for_each_in<&[rustc_hir::hir_id::OwnerId], <rustc_middle::hir::map::Map>::par_for_each_module<rustc_hir_analysis::check_crate::{closure#5}::{closure#0}::{closure#0}>::{closure#0}>::{closure#0}::{closure#0}>>
  21: rustc_data_structures::sync::par_for_each_in::<&[rustc_hir::hir_id::OwnerId], <rustc_middle::hir::map::Map>::par_for_each_module<rustc_hir_analysis::check_crate::{closure#5}::{closure#0}::{closure#0}>::{closure#0}>
  22: <rustc_session::session::Session>::track_errors::<rustc_hir_analysis::check_crate::{closure#5}, ()>
  23: rustc_hir_analysis::check_crate
  24: rustc_interface::passes::analysis
  25: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
  26: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>

@NightEule5 NightEule5 added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 30, 2023
@obeis
Copy link
Contributor

obeis commented May 30, 2023

@rustbot claim

@TaKO8Ki
Copy link
Member

TaKO8Ki commented Jun 25, 2023

Regression in 8216b7f

TaKO8Ki added a commit to TaKO8Ki/rust that referenced this issue Jun 25, 2023
@TaKO8Ki TaKO8Ki self-assigned this Jun 26, 2023
@bors bors closed this as completed in 6c75757 Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants