Skip to content

Internal compiler error in rustc 1.76.0 #121057

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

Open
skibon02 opened this issue Feb 13, 2024 · 3 comments
Open

Internal compiler error in rustc 1.76.0 #121057

skibon02 opened this issue Feb 13, 2024 · 3 comments
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

@skibon02
Copy link

skibon02 commented Feb 13, 2024

Code

// requires winit version 0.28.7
use winit::event_loop::EventLoop;



fn main() {
    let event_loop = EventLoop::new();

    event_loop.run(move |event, _, _| {
        event.to_static();

        print!("{:?}", event);
    });
}

Meta

rustc --version --verbose:

$ rustc --version --verbose
rustc 1.76.0 (07dca489a 2024-02-04)
binary: rustc
commit-hash: 07dca489ac2d933c78d3c5158e3f43beefeb02ce
commit-date: 2024-02-04
host: x86_64-unknown-linux-gnu
release: 1.76.0
LLVM version: 17.0.6

Error output

error: internal compiler error: compiler/rustc_middle/src/ty/generic_args.rs:885:9: expected type for `T/#0` (T/#0/0) but found Lifetime('?30) when substituting, args=['?30, ()]

thread 'rustc' panicked at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/compiler/rustc_errors/src/lib.rs:1119:75:
Box<dyn Any>
Backtrace

stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic_builder::Bug as rustc_errors::diagnostic_builder::EmissionGuarantee>::diagnostic_builder_emit_producing_guarantee
   2: <rustc_errors::DiagCtxt>::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_middle::ty::generic_args::ArgFolder>::type_param_expected
   8: <rustc_middle::ty::generic_args::ArgFolder as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_ty
   9: <rustc_middle::ty::Clause as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_middle::ty::generic_args::ArgFolder>
  10: <rustc_middle::ty::generics::GenericPredicates>::instantiate_into
  11: <rustc_middle::ty::generics::GenericPredicates>::instantiate
  12: <rustc_infer::infer::InferCtxt as rustc_trait_selection::infer::InferCtxtExt>::could_impl_trait
  13: <rustc_borrowck::MirBorrowckCtxt>::explain_captures
  14: <rustc_borrowck::MirBorrowckCtxt>::report_use_of_moved_or_uninitialized
  15: rustc_borrowck::do_mir_borrowck
  16: rustc_borrowck::mir_borrowck
      [... omitted 1 frame ...]
  17: <rustc_borrowck::type_check::TypeChecker>::prove_closure_bounds
  18: <rustc_borrowck::type_check::TypeChecker>::typeck_mir
  19: rustc_borrowck::type_check::type_check
  20: rustc_borrowck::nll::compute_regions
  21: rustc_borrowck::do_mir_borrowck
  22: rustc_borrowck::mir_borrowck
      [... omitted 1 frame ...]
  23: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  24: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}

Additional info

Project has a single dependency: winit = "0.28.7"
Compiler finishes without panic on older rustc versions, for example on rustc 1.75.0.

@skibon02 skibon02 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 Feb 13, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 13, 2024
@compiler-errors
Copy link
Member

Does this build on nightly?

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 14, 2024
@skibon02
Copy link
Author

yes, it finishes build with error on nightly (i was thiking it's not)

@lqd
Copy link
Member

lqd commented Feb 14, 2024

This looks similar to #119915 which errs fixed in #119934, so this doesn't ICE on beta either.

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

No branches or pull requests

5 participants