Skip to content

ICE: using lazy-regex to replace HTML with regex #109640

Closed as not planned
Closed as not planned

Description

Code

use lazy_regex::{regex, Captures};

fn replace_html(html: &str) -> String {
    let re = regex!(r"(?i)<div><br\s*/?></div>|<br\s*/?>|</div>|</p>");
    re.replace_all(html, |caps: Captures| {
        match caps.get(0).unwrap().as_str().to_lowercase().as_str() {
            "</div>" | "</p>" => "</div>\n",
            _ => "\n",
        }
    })
    .to_string()
}

fn main() {
    let html =
        "<div><br></div><div><br/></div><div><br /></div><br><br/><br /><div>content</div></p>";
    let replaced_html = replace_html(&html);
    println!("Replaced HTML:\n{}", replaced_html);
}

Meta

rustc --version --verbose:

rustc 1.68.1 (8460ca823 2023-03-20)
binary: rustc
commit-hash: 8460ca823e8367a30dda430efda790588b8c84d3
commit-date: 2023-03-20
host: x86_64-unknown-linux-gnu
release: 1.68.1
LLVM version: 15.0.6

Error output

   Compiling ice v0.1.0 (/home/satvik/Projects/Rust/ice)
error: internal compiler error: compiler/rustc_infer/src/infer/region_constraints/mod.rs:568:17: cannot relate bound region: ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:11 ~ ice[18ab]::replace_html::'_), '_) }) <= ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed(DefId(23:3266 ~ regex[3da8]::re_unicode::{impl#36}::'_#1), '_) })

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/8460ca823e8367a30dda430efda790588b8c84d3/compiler/rustc_errors/src/lib.rs:987:33
stack backtrace:
   0:     0x7f2a4467259a - std::backtrace_rs::backtrace::libunwind::trace::hba70c054c9cdbd74
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f2a4467259a - std::backtrace_rs::backtrace::trace_unsynchronized::hfff24a4d77b00fef
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f2a4467259a - std::sys_common::backtrace::_print_fmt::h6fb3e9652d3b4f4e
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f2a4467259a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h254ba81a1e20fed0
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f2a446d439e - core::fmt::write::h232ccd94259bfe24
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/core/src/fmt/mod.rs:1213:17
   5:     0x7f2a44662ce5 - std::io::Write::write_fmt::h963cfaecfdd596f7
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/io/mod.rs:1682:15
   6:     0x7f2a44672365 - std::sys_common::backtrace::_print::h6fbc4343523214ce
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f2a44672365 - std::sys_common::backtrace::print::h55ab07cec21aacd5
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f2a4467512f - std::panicking::default_hook::{{closure}}::hc10df65206eee69e
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:267:22
   9:     0x7f2a44674e6b - std::panicking::default_hook::hdd684731d8d78925
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:286:9
  10:     0x7f2a479cf6c4 - <rustc_driver[e9760e9ac6ccf54d]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[77bef6d69d927b7]::ops::function::FnOnce<(&core[77bef6d69d927b7]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f2a4467596a - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::he42fab2119ecbaf0
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/alloc/src/boxed.rs:2002:9
  12:     0x7f2a4467596a - std::panicking::rust_panic_with_hook::h58681788b2d08dc0
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/panicking.rs:692:13
  13:     0x7f2a47c8b681 - std[be43af764720b20]::panicking::begin_panic::<rustc_errors[698eb27c3a994f58]::ExplicitBug>::{closure#0}
  14:     0x7f2a47c83fd6 - std[be43af764720b20]::sys_common::backtrace::__rust_end_short_backtrace::<std[be43af764720b20]::panicking::begin_panic<rustc_errors[698eb27c3a994f58]::ExplicitBug>::{closure#0}, !>
  15:     0x7f2a47d13e26 - std[be43af764720b20]::panicking::begin_panic::<rustc_errors[698eb27c3a994f58]::ExplicitBug>
  16:     0x7f2a47d13e16 - std[be43af764720b20]::panic::panic_any::<rustc_errors[698eb27c3a994f58]::ExplicitBug>
  17:     0x7f2a47d12c92 - <rustc_errors[698eb27c3a994f58]::HandlerInner>::span_bug::<rustc_span[64b0522548f33ee1]::span_encoding::Span, &alloc[bd0f9414e0d9e44e]::string::String>
  18:     0x7f2a47d12b37 - <rustc_errors[698eb27c3a994f58]::Handler>::span_bug::<rustc_span[64b0522548f33ee1]::span_encoding::Span, &alloc[bd0f9414e0d9e44e]::string::String>
  19:     0x7f2a47cc813b - rustc_middle[cb60ee63c17a43c3]::util::bug::opt_span_bug_fmt::<rustc_span[64b0522548f33ee1]::span_encoding::Span>::{closure#0}
  20:     0x7f2a47cc818a - rustc_middle[cb60ee63c17a43c3]::ty::context::tls::with_opt::<rustc_middle[cb60ee63c17a43c3]::util::bug::opt_span_bug_fmt<rustc_span[64b0522548f33ee1]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f2a47cc724a - rustc_middle[cb60ee63c17a43c3]::ty::context::tls::with_context_opt::<rustc_middle[cb60ee63c17a43c3]::ty::context::tls::with_opt<rustc_middle[cb60ee63c17a43c3]::util::bug::opt_span_bug_fmt<rustc_span[64b0522548f33ee1]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f2a47cc7176 - rustc_middle[cb60ee63c17a43c3]::util::bug::opt_span_bug_fmt::<rustc_span[64b0522548f33ee1]::span_encoding::Span>
  23:     0x7f2a47cc7134 - rustc_middle[cb60ee63c17a43c3]::util::bug::span_bug_fmt::<rustc_span[64b0522548f33ee1]::span_encoding::Span>
  24:     0x7f2a4594e964 - <rustc_middle[cb60ee63c17a43c3]::ty::sty::Region as rustc_middle[cb60ee63c17a43c3]::ty::relate::Relate>::relate::<rustc_infer[99c2bcef2aa6f09]::infer::equate::Equate>
  25:     0x7f2a45949c1f - rustc_middle[cb60ee63c17a43c3]::ty::relate::super_relate_tys::<rustc_infer[99c2bcef2aa6f09]::infer::equate::Equate>
  26:     0x7f2a45946c1e - <rustc_infer[99c2bcef2aa6f09]::infer::equate::Equate as rustc_middle[cb60ee63c17a43c3]::ty::relate::TypeRelation>::tys
  27:     0x7f2a46292263 - <rustc_infer[99c2bcef2aa6f09]::infer::InferCtxt>::commit_if_ok::<rustc_infer[99c2bcef2aa6f09]::infer::InferOk<()>, rustc_middle[cb60ee63c17a43c3]::ty::error::TypeError, <rustc_infer[99c2bcef2aa6f09]::infer::at::Trace>::eq<rustc_middle[cb60ee63c17a43c3]::ty::Ty>::{closure#0}>
  28:     0x7f2a46292156 - <rustc_infer[99c2bcef2aa6f09]::infer::at::At>::eq::<rustc_middle[cb60ee63c17a43c3]::ty::Ty>
  29:     0x7f2a485adb2e - <rustc_infer[99c2bcef2aa6f09]::infer::InferCtxt>::can_eq::<rustc_middle[cb60ee63c17a43c3]::ty::Ty>
  30:     0x7f2a48590a82 - rustc_trait_selection[52a9c14cdc821adb]::traits::error_reporting::suggestions::hint_missing_borrow
  31:     0x7f2a48633ad4 - <rustc_infer[99c2bcef2aa6f09]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[52a9c14cdc821adb]::traits::error_reporting::suggestions::TypeErrCtxtExt>::report_closure_arg_mismatch
  32:     0x7f2a48643928 - <rustc_infer[99c2bcef2aa6f09]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[52a9c14cdc821adb]::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
  33:     0x7f2a4864d307 - <rustc_infer[99c2bcef2aa6f09]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[52a9c14cdc821adb]::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
  34:     0x7f2a4864096f - <rustc_infer[99c2bcef2aa6f09]::infer::error_reporting::TypeErrCtxt as rustc_trait_selection[52a9c14cdc821adb]::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
  35:     0x7f2a45bcb115 - <rustc_hir_typeck[ae1c700836d8ac2c]::fn_ctxt::FnCtxt>::check_argument_types
  36:     0x7f2a45b52612 - <rustc_hir_typeck[ae1c700836d8ac2c]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  37:     0x7f2a45b86461 - <rustc_hir_typeck[ae1c700836d8ac2c]::fn_ctxt::FnCtxt>::check_block_with_expected
  38:     0x7f2a45b508bc - <rustc_hir_typeck[ae1c700836d8ac2c]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  39:     0x7f2a45aeb2b1 - <rustc_hir_typeck[ae1c700836d8ac2c]::fn_ctxt::FnCtxt>::check_return_expr
  40:     0x7f2a45ae21e2 - rustc_hir_typeck[ae1c700836d8ac2c]::check::check_fn
  41:     0x7f2a45acaa9e - rustc_hir_typeck[ae1c700836d8ac2c]::typeck
  42:     0x7f2a45abc077 - <rustc_query_system[290e1790c5c3341d]::dep_graph::graph::DepGraph<rustc_middle[cb60ee63c17a43c3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[cb60ee63c17a43c3]::ty::context::TyCtxt, rustc_span[64b0522548f33ee1]::def_id::LocalDefId, &rustc_middle[cb60ee63c17a43c3]::ty::typeck_results::TypeckResults>
  43:     0x7f2a45ab3bdb - rustc_query_system[290e1790c5c3341d]::query::plumbing::try_execute_query::<rustc_query_impl[b58743651d9ff834]::queries::typeck, rustc_query_impl[b58743651d9ff834]::plumbing::QueryCtxt>
  44:     0x7f2a4712634d - rustc_data_structures[31a149139c39594b]::sync::par_for_each_in::<&[rustc_span[64b0522548f33ee1]::def_id::LocalDefId], <rustc_middle[cb60ee63c17a43c3]::hir::map::Map>::par_body_owners<rustc_hir_typeck[ae1c700836d8ac2c]::typeck_item_bodies::{closure#0}>::{closure#0}>
  45:     0x7f2a471260f3 - rustc_hir_typeck[ae1c700836d8ac2c]::typeck_item_bodies
  46:     0x7f2a47140187 - <rustc_query_system[290e1790c5c3341d]::dep_graph::graph::DepGraph<rustc_middle[cb60ee63c17a43c3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[cb60ee63c17a43c3]::ty::context::TyCtxt, (), ()>
  47:     0x7f2a46f4f356 - rustc_query_system[290e1790c5c3341d]::query::plumbing::try_execute_query::<rustc_query_impl[b58743651d9ff834]::queries::typeck_item_bodies, rustc_query_impl[b58743651d9ff834]::plumbing::QueryCtxt>
  48:     0x7f2a47387e4b - <rustc_query_impl[b58743651d9ff834]::Queries as rustc_middle[cb60ee63c17a43c3]::ty::query::QueryEngine>::typeck_item_bodies
  49:     0x7f2a45e58192 - <rustc_session[64f4b5251236b9c8]::session::Session>::time::<(), rustc_hir_analysis[f9b821eb24fbe472]::check_crate::{closure#7}>
  50:     0x7f2a45e57602 - rustc_hir_analysis[f9b821eb24fbe472]::check_crate
  51:     0x7f2a45e5725b - rustc_interface[7daf05dd7f817685]::passes::analysis
  52:     0x7f2a470f4ce6 - <rustc_query_system[290e1790c5c3341d]::dep_graph::graph::DepGraph<rustc_middle[cb60ee63c17a43c3]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[cb60ee63c17a43c3]::ty::context::TyCtxt, (), core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>>
  53:     0x7f2a470f3ea1 - rustc_query_system[290e1790c5c3341d]::query::plumbing::try_execute_query::<rustc_query_impl[b58743651d9ff834]::queries::analysis, rustc_query_impl[b58743651d9ff834]::plumbing::QueryCtxt>
  54:     0x7f2a473846fa - <rustc_query_impl[b58743651d9ff834]::Queries as rustc_middle[cb60ee63c17a43c3]::ty::query::QueryEngine>::analysis
  55:     0x7f2a46bad960 - <rustc_interface[7daf05dd7f817685]::passes::QueryContext>::enter::<rustc_driver[e9760e9ac6ccf54d]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>>
  56:     0x7f2a46bab3d4 - rustc_span[64b0522548f33ee1]::with_source_map::<core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>, rustc_interface[7daf05dd7f817685]::interface::run_compiler<core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>, rustc_driver[e9760e9ac6ccf54d]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  57:     0x7f2a46ba3df4 - <scoped_tls[d9056ea81e40aa6e]::ScopedKey<rustc_span[64b0522548f33ee1]::SessionGlobals>>::set::<rustc_interface[7daf05dd7f817685]::interface::run_compiler<core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>, rustc_driver[e9760e9ac6ccf54d]::run_compiler::{closure#1}>::{closure#0}, core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>>
  58:     0x7f2a46ba34f2 - std[be43af764720b20]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[7daf05dd7f817685]::util::run_in_thread_pool_with_globals<rustc_interface[7daf05dd7f817685]::interface::run_compiler<core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>, rustc_driver[e9760e9ac6ccf54d]::run_compiler::{closure#1}>::{closure#0}, core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>>
  59:     0x7f2a46ba329a - <<std[be43af764720b20]::thread::Builder>::spawn_unchecked_<rustc_interface[7daf05dd7f817685]::util::run_in_thread_pool_with_globals<rustc_interface[7daf05dd7f817685]::interface::run_compiler<core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>, rustc_driver[e9760e9ac6ccf54d]::run_compiler::{closure#1}>::{closure#0}, core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[77bef6d69d927b7]::result::Result<(), rustc_errors[698eb27c3a994f58]::ErrorGuaranteed>>::{closure#1} as core[77bef6d69d927b7]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  60:     0x7f2a4467f823 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h697797cc46768ced
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/alloc/src/boxed.rs:1988:9
  61:     0x7f2a4467f823 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hbf3642b6d75543dc
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/alloc/src/boxed.rs:1988:9
  62:     0x7f2a4467f823 - std::sys::unix::thread::Thread::new::thread_start::ha35bd9f58a7022de
                               at /rustc/8460ca823e8367a30dda430efda790588b8c84d3/library/std/src/sys/unix/thread.rs:108:17
  63:     0x7f2a443bfb43 - <unknown>
  64:     0x7f2a44451a00 - <unknown>
  65:                0x0 - <unknown>

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.68.1 (8460ca823 2023-03-20) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C linker=clang -C incremental=[REDACTED] -C target-cpu=native

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `replace_html`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `ice`
Backtrace

   Compiling ice v0.1.0 (/home/satvik/Projects/Rust/ice)
error: internal compiler error: compiler/rustc_infer/src/infer/region_constraints/mod.rs:568:17: cannot relate bound region: ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:11 ~ ice[18ab]::replace_html::'_), '_) }) <= ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed(DefId(23:3266 ~ regex[3da8]::re_unicode::{impl#36}::'_#1), '_) })

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/8460ca823e8367a30dda430efda790588b8c84d3/compiler/rustc_errors/src/lib.rs:987:33
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: std::panic::panic_any::<rustc_errors::ExplicitBug>
   2: <rustc_errors::HandlerInner>::span_bug::<rustc_span::span_encoding::Span, &alloc::string::String>
   3: <rustc_errors::Handler>::span_bug::<rustc_span::span_encoding::Span, &alloc::string::String>
   4: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   5: 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::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}, !>
   7: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>
   8: rustc_middle::util::bug::span_bug_fmt::<rustc_span::span_encoding::Span>
   9: <rustc_middle::ty::sty::Region as rustc_middle::ty::relate::Relate>::relate::<rustc_infer::infer::equate::Equate>
  10: rustc_middle::ty::relate::super_relate_tys::<rustc_infer::infer::equate::Equate>
  11: <rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::tys
  12: <rustc_infer::infer::InferCtxt>::commit_if_ok::<rustc_infer::infer::InferOk<()>, rustc_middle::ty::error::TypeError, <rustc_infer::infer::at::Trace>::eq<rustc_middle::ty::Ty>::{closure#0}>
  13: <rustc_infer::infer::at::At>::eq::<rustc_middle::ty::Ty>
  14: <rustc_infer::infer::InferCtxt>::can_eq::<rustc_middle::ty::Ty>
  15: rustc_trait_selection::traits::error_reporting::suggestions::hint_missing_borrow
  16: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::suggestions::TypeErrCtxtExt>::report_closure_arg_mismatch
  17: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt>::report_selection_error
  18: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
  19: <rustc_infer::infer::error_reporting::TypeErrCtxt as rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt>::report_fulfillment_errors
  20: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  21: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  22: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  23: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  24: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
  25: rustc_hir_typeck::check::check_fn
  26: rustc_hir_typeck::typeck
  27: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::typeck_results::TypeckResults>
  28: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
  29: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_typeck::typeck_item_bodies::{closure#0}>::{closure#0}>
  30: rustc_hir_typeck::typeck_item_bodies
  31: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), ()>
  32: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
  33: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
  34: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
  35: rustc_hir_analysis::check_crate
  36: rustc_interface::passes::analysis
  37: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  38: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  39: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  40: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#2}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  41: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  42: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
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.68.1 (8460ca823 2023-03-20) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C linker=clang -C incremental=[REDACTED] -C target-cpu=native

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `replace_html`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `ice`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions