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

ICE while using Rocket #103612

Closed
garageagleMC opened this issue Oct 27, 2022 · 3 comments
Closed

ICE while using Rocket #103612

garageagleMC opened this issue Oct 27, 2022 · 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

@garageagleMC
Copy link

This bug occurred when using Rocket, and with all its crazy macros I'm not quite sure how to minimize my code. 😅 Hopefully what I've shown will still help somewhat.

Code

#[derive(FromForm)]
struct SteamResult<'r> {
    openid: OpenId<'r>
}

#[derive(FromForm)]
struct OpenId<'r> {
    // ...
    identity: &'r str,
    // ...
}
// ...
#[get("/auth?<steam_result..>")]
fn api_auth(steam_result: SteamResult<'static>, cookies: &CookieJar<'_>) -> &'static str {
    steam_result.openid.identity
}

Meta

rustc --version --verbose:

rustc 1.66.0-nightly (758f19645 2022-10-24)
binary: rustc
commit-hash: 758f19645b8ebce61ea52d1f6672fd057bc8dbee
commit-date: 2022-10-24
host: x86_64-pc-windows-msvc
release: 1.66.0-nightly
LLVM version: 15.0.2

Error output

thread 'rustc' panicked at 'index out of bounds: the len is 10 but the index is 48', compiler\rustc_middle\src\mir\mod.rs:455:27

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: `InferCtxt` incorrectly tainted by errors
  |
  = note: delayed at compiler\rustc_infer\src\infer\mod.rs:1256:27
Backtrace (full)

thread 'rustc' panicked at 'index out of bounds: the len is 10 but the index is 48', compiler\rustc_middle\src\mir\mod.rs:455:27
stack backtrace:
   0:     0x7fff0bc59a42 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5779501fce48e852
   1:     0x7fff0bc953cb - core::fmt::write::hbb48dc4d168f47f8
   2:     0x7fff0bc4c03a - <std::io::IoSlice as core::fmt::Debug>::fmt::hb888ab8b2abd378a
   3:     0x7fff0bc5978b - std::sys::common::alloc::realloc_fallback::h0ad29843b461d69c
   4:     0x7fff0bc5d0e9 - std::panicking::default_hook::hb2454d715314d32e
   5:     0x7fff0bc5cd6a - std::panicking::default_hook::hb2454d715314d32e
   6:     0x7ffee690e2fe - rustc_driver[24e7544a396833b6]::describe_lints
   7:     0x7fff0bc5da40 - std::panicking::rust_panic_with_hook::hf2b7e211705609b3
   8:     0x7fff0bc5d79d - <std::panicking::begin_panic_handler::StrPanicPayload as core::panic::BoxMeUp>::get::h24b0f28eca9e897c
   9:     0x7fff0bc5a74f - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5779501fce48e852
  10:     0x7fff0bc5d460 - rust_begin_unwind
  11:     0x7fff0bccb2e5 - core::panicking::panic_fmt::h1c9cc57277f268a7
  12:     0x7fff0bccb457 - core::panicking::panic_bounds_check::h161573fcc7c3c90b
  13:     0x7ffee8be60b9 - <rustc_middle[37b948dedc2b15e2]::mir::Body>::stmt_at
  14:     0x7ffee5f93172 - <rustc_mir_build[92c1400cabd8a9b]::build::expr::as_place::PlaceBuilder as core[a11597295d76005f]::convert::From<rustc_middle[37b948dedc2b15e2]::mir::Local>>::from
  15:     0x7ffee5f82726 - <rustc_mir_build[92c1400cabd8a9b]::build::expr::as_place::PlaceBuilder as core[a11597295d76005f]::convert::From<rustc_middle[37b948dedc2b15e2]::mir::Local>>::from
  16:     0x7ffee5f81f78 - <rustc_mir_build[92c1400cabd8a9b]::build::expr::as_place::PlaceBuilder as core[a11597295d76005f]::convert::From<rustc_middle[37b948dedc2b15e2]::mir::Local>>::from
  17:     0x7ffee4b43dd8 - <rustc_const_eval[d0cf3916f71e56fd]::transform::check_consts::ops::ty::MutRef as rustc_const_eval[d0cf3916f71e56fd]::transform::check_consts::ops::NonConstOp>::status_in_item
  18:     0x7ffee4bc8dd5 - <&[(rustc_middle[37b948dedc2b15e2]::middle::exported_symbols::ExportedSymbol, rustc_middle[37b948dedc2b15e2]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[59e931bf5454c2a3]::serialize::Decodable<rustc_query_impl[14b1cc3c
799bd125]::on_disk_cache::CacheDecoder>>::decode
  19:     0x7ffee62ce19c - <rustc_span[2833a328f5f547d1]::def_id::DefId as rustc_serialize[59e931bf5454c2a3]::serialize::Encodable<rustc_query_impl[14b1cc3c799bd125]::on_disk_cache::CacheEncoder>>::encode
  20:     0x7ffee61e9555 - <rustc_query_impl[14b1cc3c799bd125]::Queries as rustc_middle[37b948dedc2b15e2]::ty::query::QueryEngine>::as_any
  21:     0x7ffee5078da4 - once_cell[cbcf79104f761141]::imp::initialize_or_wait
  22:     0x7ffee4186b22 - rustc_interface[6f4f7b47aa55ad55]::passes::analysis
  23:     0x7ffee4b4567e - <rustc_const_eval[d0cf3916f71e56fd]::transform::check_consts::ops::ty::MutRef as rustc_const_eval[d0cf3916f71e56fd]::transform::check_consts::ops::NonConstOp>::status_in_item
  24:     0x7ffee4be95c9 - <&[(rustc_middle[37b948dedc2b15e2]::middle::exported_symbols::ExportedSymbol, rustc_middle[37b948dedc2b15e2]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[59e931bf5454c2a3]::serialize::Decodable<rustc_query_impl[14b1cc3c
799bd125]::on_disk_cache::CacheDecoder>>::decode
  25:     0x7ffee4cc031e - <&[(rustc_middle[37b948dedc2b15e2]::middle::exported_symbols::ExportedSymbol, rustc_middle[37b948dedc2b15e2]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[59e931bf5454c2a3]::serialize::Decodable<rustc_query_impl[14b1cc3c
799bd125]::on_disk_cache::CacheDecoder>>::decode
  26:     0x7ffee4d0f916 - <&[(rustc_middle[37b948dedc2b15e2]::middle::exported_symbols::ExportedSymbol, rustc_middle[37b948dedc2b15e2]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[59e931bf5454c2a3]::serialize::Decodable<rustc_query_impl[14b1cc3c
799bd125]::on_disk_cache::CacheDecoder>>::decode
  27:     0x7ffee412bd44 - <unknown>
  28:     0x7ffee413c638 - <rustc_middle[37b948dedc2b15e2]::ty::SymbolName as core[a11597295d76005f]::fmt::Debug>::fmt
  29:     0x7ffee413b78d - rustc_driver[24e7544a396833b6]::args::arg_expand_all
  30:     0x7ffee412c809 - <unknown>
  31:     0x7ffee4123990 - <unknown>
  32:     0x7fff0bc6e7fc - std::sys::windows::thread::Thread::new::hd5e01c58a538008b
  33:     0x7fff8db97034 - BaseThreadInitThunk
  34:     0x7fff8ef426a1 - RtlUserThreadStart

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.66.0-nightly (758f19645 2022-10-24) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type bin -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 [mir_borrowck] borrow-checking `<impl at src\main.rs:48:1: 48:33>::into_info::monomorphized_function`
#1 [analysis] running analysis passes on this crate
end of query stack
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: `InferCtxt` incorrectly tainted by errors
  |
  = note: delayed at compiler\rustc_infer\src\infer\mod.rs:1256:27

thread 'rustc' panicked at 'Box<dyn Any>', compiler\rustc_errors\src\lib.rs:1553:13
stack backtrace:
   0:     0x7fff0bc59a42 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5779501fce48e852
   1:     0x7fff0bc953cb - core::fmt::write::hbb48dc4d168f47f8
   2:     0x7fff0bc4c03a - <std::io::IoSlice as core::fmt::Debug>::fmt::hb888ab8b2abd378a
   3:     0x7fff0bc5978b - std::sys::common::alloc::realloc_fallback::h0ad29843b461d69c
   4:     0x7fff0bc5d0e9 - std::panicking::default_hook::hb2454d715314d32e
   5:     0x7fff0bc5cd6a - std::panicking::default_hook::hb2454d715314d32e
   6:     0x7ffee690e2fe - rustc_driver[24e7544a396833b6]::describe_lints
   7:     0x7fff0bc5da40 - std::panicking::rust_panic_with_hook::hf2b7e211705609b3
   8:     0x7ffee8cdf1e3 - <rustc_hir[71d579c5191f9955]::target::Target as rustc_errors[a2af04ddf144f93c]::diagnostic::IntoDiagnosticArg>::into_diagnostic_arg
   9:     0x7ffee8cdd9c9 - <rustc_hir[71d579c5191f9955]::target::Target as rustc_errors[a2af04ddf144f93c]::diagnostic::IntoDiagnosticArg>::into_diagnostic_arg
  10:     0x7ffee8ccaea9 - <rustc_errors[a2af04ddf144f93c]::emitter::DisplaySuggestion as core[a11597295d76005f]::fmt::Debug>::fmt
  11:     0x7ffee8cc3199 - <getopts[4e17e3985736d56d]::Fail as core[a11597295d76005f]::fmt::Debug>::fmt
  12:     0x7ffee5009063 - <rustc_errors[a2af04ddf144f93c]::HandlerInner>::emit_diagnostic
  13:     0x7ffee50062d2 - <rustc_errors[a2af04ddf144f93c]::HandlerInner as core[a11597295d76005f]::ops::drop::Drop>::drop
  14:     0x7ffee4126569 - <unknown>
  15:     0x7ffee412868c - <unknown>
  16:     0x7ffee414e159 - <rustc_middle[37b948dedc2b15e2]::ty::SymbolName as core[a11597295d76005f]::fmt::Debug>::fmt
  17:     0x7ffee413d9c7 - <rustc_middle[37b948dedc2b15e2]::ty::SymbolName as core[a11597295d76005f]::fmt::Debug>::fmt
  18:     0x7ffee6892770 - _rust_realloc
  19:     0x7ffee6891bc6 - _rust_realloc
  20:     0x7ffee688d958 - _rust_realloc
  21:     0x7ffee6890f2d - _rust_realloc
  22:     0x7ffee688e271 - _rust_realloc
  23:     0x7fff8ef9249f - _chkstk
  24:     0x7fff8ef20939 - RtlUnwindEx
  25:     0x7ffee688de22 - _rust_realloc
  26:     0x7ffee688fbd9 - _rust_realloc
  27:     0x7ffee688ffef - _rust_realloc
  28:     0x7ffee6891029 - _rust_realloc
  29:     0x7ffee688e271 - _rust_realloc
  30:     0x7fff8ef9241f - _chkstk
  31:     0x7fff8ef414a4 - RtlRaiseException
  32:     0x7fff8ef411f5 - RtlRaiseException
  33:     0x7fff8c92cd29 - RaiseException
  34:     0x7fff0bcbe248 - _umodti3
  35:     0x7fff0bc73e7e - _rust_start_panic
  36:     0x7fff0bc5dc7b - rust_panic
  37:     0x7fff0bc5dbff - std::panicking::rust_panic_with_hook::hf2b7e211705609b3
  38:     0x7fff0bc51ad9 - std::panic::resume_unwind::hdc708809c30ec1ff
  39:     0x7ffee5078f95 - once_cell[cbcf79104f761141]::imp::initialize_or_wait
  40:     0x7ffee4186b22 - rustc_interface[6f4f7b47aa55ad55]::passes::analysis
  41:     0x7ffee4b4567e - <rustc_const_eval[d0cf3916f71e56fd]::transform::check_consts::ops::ty::MutRef as rustc_const_eval[d0cf3916f71e56fd]::transform::check_consts::ops::NonConstOp>::status_in_item
  42:     0x7ffee4be95c9 - <&[(rustc_middle[37b948dedc2b15e2]::middle::exported_symbols::ExportedSymbol, rustc_middle[37b948dedc2b15e2]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[59e931bf5454c2a3]::serialize::Decodable<rustc_query_impl[14b1cc3c
799bd125]::on_disk_cache::CacheDecoder>>::decode
  43:     0x7ffee4cc031e - <&[(rustc_middle[37b948dedc2b15e2]::middle::exported_symbols::ExportedSymbol, rustc_middle[37b948dedc2b15e2]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[59e931bf5454c2a3]::serialize::Decodable<rustc_query_impl[14b1cc3c
799bd125]::on_disk_cache::CacheDecoder>>::decode
  44:     0x7ffee4d0f916 - <&[(rustc_middle[37b948dedc2b15e2]::middle::exported_symbols::ExportedSymbol, rustc_middle[37b948dedc2b15e2]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[59e931bf5454c2a3]::serialize::Decodable<rustc_query_impl[14b1cc3c
799bd125]::on_disk_cache::CacheDecoder>>::decode
  45:     0x7ffee412bd44 - <unknown>
  46:     0x7ffee413c638 - <rustc_middle[37b948dedc2b15e2]::ty::SymbolName as core[a11597295d76005f]::fmt::Debug>::fmt
  47:     0x7ffee413b78d - rustc_driver[24e7544a396833b6]::args::arg_expand_all
  48:     0x7ffee412c809 - <unknown>
  49:     0x7ffee4123990 - <unknown>
  50:     0x7fff0bc6e7fc - std::sys::windows::thread::Thread::new::hd5e01c58a538008b
  51:     0x7fff8db97034 - BaseThreadInitThunk
  52:     0x7fff8ef426a1 - RtlUserThreadStart

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.66.0-nightly (758f19645 2022-10-24) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type bin -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:
end of query stack
thread panicked while panicking. aborting.

@garageagleMC garageagleMC 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 Oct 27, 2022
@compiler-errors
Copy link
Member

This seems to be the same underlying issue as #103624

@JohnTitor
Copy link
Member

@garageagleMC Could you check if the latest nightly fixes your issue?

@JohnTitor
Copy link
Member

Triage: Closing as fixed, @garageagleMC feel free to re-open if not, thanks!

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

3 participants