Skip to content

internal compiler error #103906

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

Closed
aalhitennf opened this issue Nov 2, 2022 · 2 comments
Closed

internal compiler error #103906

aalhitennf opened this issue Nov 2, 2022 · 2 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

@aalhitennf
Copy link

aalhitennf commented Nov 2, 2022

Code

use std::path::Path;

fn main() {
    let path = Path::from(format!("./new/path"));
}

Meta

rustc --version --verbose:

rustc 1.66.0-nightly (98ad6a551 2022-09-17)
binary: rustc
commit-hash: 98ad6a5519651af36e246c0335c964dd52c554ba
commit-date: 2022-09-17
host: x86_64-unknown-linux-gnu
release: 1.66.0-nightly
LLVM version: 15.0.0

Error output

error: internal compiler error: compiler/rustc_middle/src/ty/context.rs:703:13: node_type: no type for node `expr {
                                        let res = $crate::fmt::format($crate::__export::format_args!($($arg)*));
                                        res
                                    } (hir_id=HirId { owner: DefId(0:6 ~ rusttest[d211]::main), local_id: 30 })`
Backtrace

    Checking rusttest v0.1.0 (/home/user/temp/rusttest)
error: internal compiler error: compiler/rustc_middle/src/ty/context.rs:703:13: node_type: no type for node `expr {
                                        let res = $crate::fmt::format($crate::__export::format_args!($($arg)*));
                                        res
                                    } (hir_id=HirId { owner: DefId(0:6 ~ rusttest[d211]::main), local_id: 30 })`

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/compiler/rustc_errors/src/lib.rs:1462:9
stack backtrace:
   0:     0x7f1304f6ec90 - std::backtrace_rs::backtrace::libunwind::trace::h4c56f7c1d2b54c49
                               at /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7f1304f6ec90 - std::backtrace_rs::backtrace::trace_unsynchronized::h43647f7dfa7709b7
                               at /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f1304f6ec90 - std::sys_common::backtrace::_print_fmt::hb05bf7e901883977
                               at /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f1304f6ec90 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd3f800102e692f91
                               at /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f1304fc99ee - core::fmt::write::h7e5f4e1d134bd366
                               at /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/library/core/src/fmt/mod.rs:1202:17
   5:     0x7f1304f5f7a5 - std::io::Write::write_fmt::h51d5f9bde508a4b0
                               at /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/library/std/src/io/mod.rs:1679:15
   6:     0x7f1304f71943 - std::sys_common::backtrace::_print::he94aa0f6090079de
                               at /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f1304f71943 - std::sys_common::backtrace::print::h925dfd7226e7fc1e
                               at /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f1304f71943 - std::panicking::default_hook::{{closure}}::hc105f3dae8d240c7
                               at /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/library/std/src/panicking.rs:295:22
   9:     0x7f1304f7162f - std::panicking::default_hook::h61df943bb9a1db3e
                               at /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/library/std/src/panicking.rs:314:9
  10:     0x7f1307791841 - <rustc_driver[b2799e8e9d23a331]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[6aaae1b9f6165ef5]::ops::function::FnOnce<(&core[6aaae1b9f6165ef5]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f1304f7217d - std::panicking::rust_panic_with_hook::hba475cb83ede0ec8
                               at /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/library/std/src/panicking.rs:702:17
  12:     0x7f1308721a61 - std[a5883580e816d278]::panicking::begin_panic::<rustc_errors[baf398c4e4a44aae]::ExplicitBug>::{closure#0}
  13:     0x7f130871f376 - std[a5883580e816d278]::sys_common::backtrace::__rust_end_short_backtrace::<std[a5883580e816d278]::panicking::begin_panic<rustc_errors[baf398c4e4a44aae]::ExplicitBug>::{closure#0}, !>
  14:     0x7f1308778df6 - std[a5883580e816d278]::panicking::begin_panic::<rustc_errors[baf398c4e4a44aae]::ExplicitBug>
  15:     0x7f130871f366 - std[a5883580e816d278]::panic::panic_any::<rustc_errors[baf398c4e4a44aae]::ExplicitBug>
  16:     0x7f130871896f - <rustc_errors[baf398c4e4a44aae]::HandlerInner>::bug::<&alloc[a1054cdcd174e9f2]::string::String>
  17:     0x7f13087183a0 - <rustc_errors[baf398c4e4a44aae]::Handler>::bug::<&alloc[a1054cdcd174e9f2]::string::String>
  18:     0x7f13087d410d - rustc_middle[f523fabf12fc9d10]::ty::context::tls::with_context_opt::<rustc_middle[f523fabf12fc9d10]::ty::context::tls::with_opt<rustc_middle[f523fabf12fc9d10]::util::bug::opt_span_bug_fmt<rustc_span[984984a74fa6b159]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  19:     0x7f13087d7486 - rustc_middle[f523fabf12fc9d10]::util::bug::opt_span_bug_fmt::<rustc_span[984984a74fa6b159]::span_encoding::Span>
  20:     0x7f13062028c3 - rustc_middle[f523fabf12fc9d10]::util::bug::bug_fmt
  21:     0x7f130669368d - <rustc_middle[f523fabf12fc9d10]::ty::context::TypeckResults>::expr_ty_adjusted
  22:     0x7f13085998cc - <rustc_infer[f83f147bc8e5765c]::infer::InferCtxt as rustc_trait_selection[a9e52ecafa1ed921]::traits::error_reporting::suggestions::InferCtxtExt>::note_obligation_cause_code::<rustc_middle[f523fabf12fc9d10]::ty::Predicate>
  23:     0x7f13085a90cf - <rustc_infer[f83f147bc8e5765c]::infer::InferCtxt as rustc_trait_selection[a9e52ecafa1ed921]::traits::error_reporting::InferCtxtPrivExt>::note_obligation_cause
  24:     0x7f13085a04c8 - <rustc_infer[f83f147bc8e5765c]::infer::InferCtxt as rustc_trait_selection[a9e52ecafa1ed921]::traits::error_reporting::InferCtxtExt>::report_selection_error
  25:     0x7f13085aca1a - <rustc_infer[f83f147bc8e5765c]::infer::InferCtxt as rustc_trait_selection[a9e52ecafa1ed921]::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
  26:     0x7f130859efb0 - <rustc_infer[f83f147bc8e5765c]::infer::InferCtxt as rustc_trait_selection[a9e52ecafa1ed921]::traits::error_reporting::InferCtxtExt>::report_fulfillment_errors
  27:     0x7f1306255564 - <rustc_typeck[c5d67e60c367a68d]::check::fn_ctxt::FnCtxt>::check_call
  28:     0x7f13061cf9e0 - <rustc_typeck[c5d67e60c367a68d]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  29:     0x7f130624e91f - <rustc_typeck[c5d67e60c367a68d]::check::fn_ctxt::FnCtxt>::check_decl
  30:     0x7f130624b083 - <rustc_typeck[c5d67e60c367a68d]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  31:     0x7f13061cfb09 - <rustc_typeck[c5d67e60c367a68d]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  32:     0x7f1306e6bbb6 - <rustc_typeck[c5d67e60c367a68d]::check::fn_ctxt::FnCtxt>::check_return_expr
  33:     0x7f1306e64421 - rustc_typeck[c5d67e60c367a68d]::check::check::check_fn
  34:     0x7f1306e5657c - <rustc_infer[f83f147bc8e5765c]::infer::InferCtxtBuilder>::enter::<&rustc_middle[f523fabf12fc9d10]::ty::context::TypeckResults, <rustc_typeck[c5d67e60c367a68d]::check::inherited::InheritedBuilder>::enter<rustc_typeck[c5d67e60c367a68d]::check::typeck_with_fallback<rustc_typeck[c5d67e60c367a68d]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[f523fabf12fc9d10]::ty::context::TypeckResults>::{closure#0}>
  35:     0x7f1306e54739 - rustc_typeck[c5d67e60c367a68d]::check::typeck
  36:     0x7f1306ab98ed - <rustc_query_system[c9be0f831edebe17]::dep_graph::graph::DepGraph<rustc_middle[f523fabf12fc9d10]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[f523fabf12fc9d10]::ty::context::TyCtxt, rustc_span[984984a74fa6b159]::def_id::LocalDefId, &rustc_middle[f523fabf12fc9d10]::ty::context::TypeckResults>
  37:     0x7f1306aa3ed2 - rustc_query_system[c9be0f831edebe17]::query::plumbing::try_execute_query::<rustc_query_impl[a8090ca1a822edb3]::plumbing::QueryCtxt, rustc_query_system[c9be0f831edebe17]::query::caches::DefaultCache<rustc_span[984984a74fa6b159]::def_id::LocalDefId, &rustc_middle[f523fabf12fc9d10]::ty::context::TypeckResults>>
  38:     0x7f13076de51e - <rustc_query_impl[a8090ca1a822edb3]::Queries as rustc_middle[f523fabf12fc9d10]::ty::query::QueryEngine>::typeck
  39:     0x7f1307523257 - rustc_data_structures[21257fff6ac147de]::sync::par_for_each_in::<&[rustc_span[984984a74fa6b159]::def_id::LocalDefId], <rustc_middle[f523fabf12fc9d10]::hir::map::Map>::par_body_owners<rustc_typeck[c5d67e60c367a68d]::check::typeck_item_bodies::{closure#0}>::{closure#0}>
  40:     0x7f1307523013 - rustc_typeck[c5d67e60c367a68d]::check::typeck_item_bodies
  41:     0x7f13074bb405 - <rustc_query_system[c9be0f831edebe17]::dep_graph::graph::DepGraph<rustc_middle[f523fabf12fc9d10]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[f523fabf12fc9d10]::ty::context::TyCtxt, (), ()>
  42:     0x7f13074ba428 - rustc_query_system[c9be0f831edebe17]::query::plumbing::try_execute_query::<rustc_query_impl[a8090ca1a822edb3]::plumbing::QueryCtxt, rustc_query_system[c9be0f831edebe17]::query::caches::DefaultCache<(), ()>>
  43:     0x7f13074b9e37 - rustc_query_system[c9be0f831edebe17]::query::plumbing::get_query::<rustc_query_impl[a8090ca1a822edb3]::queries::typeck_item_bodies, rustc_query_impl[a8090ca1a822edb3]::plumbing::QueryCtxt>
  44:     0x7f1306ac34bf - <rustc_session[7645e3b57a32b942]::session::Session>::time::<(), rustc_typeck[c5d67e60c367a68d]::check_crate::{closure#7}>
  45:     0x7f1306ac307f - rustc_typeck[c5d67e60c367a68d]::check_crate
  46:     0x7f1306ac2647 - rustc_interface[fb7c461139344b9a]::passes::analysis
  47:     0x7f1307573d12 - <rustc_query_system[c9be0f831edebe17]::dep_graph::graph::DepGraph<rustc_middle[f523fabf12fc9d10]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[f523fabf12fc9d10]::ty::context::TyCtxt, (), core[6aaae1b9f6165ef5]::result::Result<(), rustc_errors[baf398c4e4a44aae]::ErrorGuaranteed>>
  48:     0x7f1307573406 - rustc_query_system[c9be0f831edebe17]::query::plumbing::try_execute_query::<rustc_query_impl[a8090ca1a822edb3]::plumbing::QueryCtxt, rustc_query_system[c9be0f831edebe17]::query::caches::DefaultCache<(), core[6aaae1b9f6165ef5]::result::Result<(), rustc_errors[baf398c4e4a44aae]::ErrorGuaranteed>>>
  49:     0x7f1307572ee7 - rustc_query_system[c9be0f831edebe17]::query::plumbing::get_query::<rustc_query_impl[a8090ca1a822edb3]::queries::analysis, rustc_query_impl[a8090ca1a822edb3]::plumbing::QueryCtxt>
  50:     0x7f1306559ba7 - <rustc_interface[fb7c461139344b9a]::passes::QueryContext>::enter::<rustc_driver[b2799e8e9d23a331]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[6aaae1b9f6165ef5]::result::Result<(), rustc_errors[baf398c4e4a44aae]::ErrorGuaranteed>>
  51:     0x7f130654d6fc - rustc_interface[fb7c461139344b9a]::interface::create_compiler_and_run::<core[6aaae1b9f6165ef5]::result::Result<(), rustc_errors[baf398c4e4a44aae]::ErrorGuaranteed>, rustc_driver[b2799e8e9d23a331]::run_compiler::{closure#1}>
  52:     0x7f130654c032 - <scoped_tls[c55e020ea1112bf8]::ScopedKey<rustc_span[984984a74fa6b159]::SessionGlobals>>::set::<rustc_interface[fb7c461139344b9a]::interface::run_compiler<core[6aaae1b9f6165ef5]::result::Result<(), rustc_errors[baf398c4e4a44aae]::ErrorGuaranteed>, rustc_driver[b2799e8e9d23a331]::run_compiler::{closure#1}>::{closure#0}, core[6aaae1b9f6165ef5]::result::Result<(), rustc_errors[baf398c4e4a44aae]::ErrorGuaranteed>>
  53:     0x7f130654bd1f - std[a5883580e816d278]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[fb7c461139344b9a]::util::run_in_thread_pool_with_globals<rustc_interface[fb7c461139344b9a]::interface::run_compiler<core[6aaae1b9f6165ef5]::result::Result<(), rustc_errors[baf398c4e4a44aae]::ErrorGuaranteed>, rustc_driver[b2799e8e9d23a331]::run_compiler::{closure#1}>::{closure#0}, core[6aaae1b9f6165ef5]::result::Result<(), rustc_errors[baf398c4e4a44aae]::ErrorGuaranteed>>::{closure#0}, core[6aaae1b9f6165ef5]::result::Result<(), rustc_errors[baf398c4e4a44aae]::ErrorGuaranteed>>
  54:     0x7f1307603f60 - <<std[a5883580e816d278]::thread::Builder>::spawn_unchecked_<rustc_interface[fb7c461139344b9a]::util::run_in_thread_pool_with_globals<rustc_interface[fb7c461139344b9a]::interface::run_compiler<core[6aaae1b9f6165ef5]::result::Result<(), rustc_errors[baf398c4e4a44aae]::ErrorGuaranteed>, rustc_driver[b2799e8e9d23a331]::run_compiler::{closure#1}>::{closure#0}, core[6aaae1b9f6165ef5]::result::Result<(), rustc_errors[baf398c4e4a44aae]::ErrorGuaranteed>>::{closure#0}, core[6aaae1b9f6165ef5]::result::Result<(), rustc_errors[baf398c4e4a44aae]::ErrorGuaranteed>>::{closure#1} as core[6aaae1b9f6165ef5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  55:     0x7f1304f7bf53 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7d016ea8ca921d7f
                               at /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/library/alloc/src/boxed.rs:1940:9
  56:     0x7f1304f7bf53 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf202f70e5b98a6cb
                               at /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/library/alloc/src/boxed.rs:1940:9
  57:     0x7f1304f7bf53 - std::sys::unix::thread::Thread::new::thread_start::hdc948a6935722a5a
                               at /rustc/98ad6a5519651af36e246c0335c964dd52c554ba/library/std/src/sys/unix/thread.rs:108:17
  58:     0x7f1304d1d8fd - <unknown>
  59:     0x7f1304d9fa60 - <unknown>
  60:                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.66.0-nightly (98ad6a551 2022-09-17) running on x86_64-unknown-linux-gnu

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 [typeck] type-checking `main`
#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 `rusttest`


@aalhitennf aalhitennf 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 Nov 2, 2022
@Rageking8
Copy link
Contributor

No longer ICEs on latest nightly. Marking a E-needs-test, if this is wrong do change to back. Thanks.

@rustbot label +E-needs-test

@rustbot claim
Add the test

@rustbot rustbot added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Nov 3, 2022
@Rageking8
Copy link
Contributor

Issue fixed and test not required as checked with @compiler-errors on discord

@rustbot label -E-needs-test

@rustbot release-assignment

@rustbot rustbot removed the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Nov 3, 2022
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

4 participants