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: Err on value: "core", map_unit_fn.rs #109152

Closed
matthiaskrgr opened this issue Mar 14, 2023 · 1 comment · Fixed by #109154
Closed

ICE: Err on value: "core", map_unit_fn.rs #109152

matthiaskrgr opened this issue Mar 14, 2023 · 1 comment · Fixed by #109154
Assignees
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. 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

@matthiaskrgr
Copy link
Member

Code

#![crate_type = "lib"]
fn _y() {
    vec![42].iter().map(drop);
}

Meta

rustc --version --verbose:

rustc 1.70.0-nightly (22f247c6f 2023-03-13)
binary: rustc
commit-hash: 22f247c6f3ed388cb702d01c2ff27da658a8b353
commit-date: 2023-03-13
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7

Error output

<output>
Backtrace

warning: unused `Map` that must be used
 --> treereduce.out:3:5
  |
3 |     vec![42].iter().map(drop);
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: iterators are lazy and do nothing unless consumed
  = note: `#[warn(unused_must_use)]` on by default

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: "core"', compiler/rustc_lint/src/map_unit_fn.rs:67:78
stack backtrace:
   0:     0x7f010976651a - std::backtrace_rs::backtrace::libunwind::trace::h1ac6254167c780d9
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f010976651a - std::backtrace_rs::backtrace::trace_unsynchronized::hec2af85915e24f36
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f010976651a - std::sys_common::backtrace::_print_fmt::h58a4e3535fcce206
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f010976651a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5107e13758b8321c
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f01097c9c5e - core::fmt::write::h2e851dc027730d81
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/core/src/fmt/mod.rs:1232:17
   5:     0x7f0109759375 - std::io::Write::write_fmt::hca00074de9f85084
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/io/mod.rs:1684:15
   6:     0x7f01097662e5 - std::sys_common::backtrace::_print::h870053c845cddf24
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f01097662e5 - std::sys_common::backtrace::print::hb56add862f96c5fd
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f010976905f - std::panicking::default_hook::{{closure}}::h636d4ba3ff8fdc46
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:271:22
   9:     0x7f0109768d9b - std::panicking::default_hook::hf29b58145ee6e43c
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:290:9
  10:     0x7f010ca580c5 - <rustc_driver_impl[74350ec99973fded]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[2011dc7817943e09]::ops::function::FnOnce<(&core[2011dc7817943e09]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f010976989d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h7342d57f33f6634f
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/alloc/src/boxed.rs:2002:9
  12:     0x7f010976989d - std::panicking::rust_panic_with_hook::hbf9ef936d990c16f
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:696:13
  13:     0x7f0109769619 - std::panicking::begin_panic_handler::{{closure}}::h6be6433dcb901f4b
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:583:13
  14:     0x7f0109766986 - std::sys_common::backtrace::__rust_end_short_backtrace::h802b6104a4d80829
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys_common/backtrace.rs:150:18
  15:     0x7f0109769322 - rust_begin_unwind
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/panicking.rs:579:5
  16:     0x7f01097c5fb3 - core::panicking::panic_fmt::hf7a8a88b9669732e
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/core/src/panicking.rs:64:14
  17:     0x7f01097c6543 - core::result::unwrap_failed::hcd86a721526c2121
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/core/src/result.rs:1750:5
  18:     0x7f010b3b6c44 - <rustc_lint[c11cb6a8cfa5f7c9]::late::LateContextAndPass<rustc_lint[c11cb6a8cfa5f7c9]::BuiltinCombinedModuleLateLintPass> as rustc_hir[ca07edd3831bb6e2]::intravisit::Visitor>::visit_stmt
  19:     0x7f010b3abe5e - <rustc_lint[c11cb6a8cfa5f7c9]::late::LateContextAndPass<rustc_lint[c11cb6a8cfa5f7c9]::BuiltinCombinedModuleLateLintPass> as rustc_hir[ca07edd3831bb6e2]::intravisit::Visitor>::visit_expr
  20:     0x7f010b8b79ab - rustc_hir[ca07edd3831bb6e2]::intravisit::walk_fn::<rustc_lint[c11cb6a8cfa5f7c9]::late::LateContextAndPass<rustc_lint[c11cb6a8cfa5f7c9]::BuiltinCombinedModuleLateLintPass>>
  21:     0x7f010b8afe63 - rustc_hir[ca07edd3831bb6e2]::intravisit::walk_item::<rustc_lint[c11cb6a8cfa5f7c9]::late::LateContextAndPass<rustc_lint[c11cb6a8cfa5f7c9]::BuiltinCombinedModuleLateLintPass>>
  22:     0x7f010b8af599 - rustc_hir[ca07edd3831bb6e2]::intravisit::walk_mod::<rustc_lint[c11cb6a8cfa5f7c9]::late::LateContextAndPass<rustc_lint[c11cb6a8cfa5f7c9]::BuiltinCombinedModuleLateLintPass>>
  23:     0x7f010b8aef13 - rustc_lint[c11cb6a8cfa5f7c9]::late::late_lint_mod::<rustc_lint[c11cb6a8cfa5f7c9]::BuiltinCombinedModuleLateLintPass>
  24:     0x7f010b8aed0c - rustc_lint[c11cb6a8cfa5f7c9]::lint_mod
  25:     0x7f010c0988ce - rustc_query_system[f881c7f40ee7dcf0]::query::plumbing::try_execute_query::<rustc_query_impl[eb95ff51c492efdd]::queries::lint_mod, rustc_query_impl[eb95ff51c492efdd]::plumbing::QueryCtxt>
  26:     0x7f010c098453 - <rustc_query_impl[eb95ff51c492efdd]::Queries as rustc_middle[eaae5d2a0b8f0144]::ty::query::QueryEngine>::lint_mod
  27:     0x7f010ae3dfe8 - rustc_data_structures[75b47a18491287a9]::sync::par_for_each_in::<&[rustc_hir[ca07edd3831bb6e2]::hir_id::OwnerId], <rustc_middle[eaae5d2a0b8f0144]::hir::map::Map>::par_for_each_module<rustc_lint[c11cb6a8cfa5f7c9]::late::check_crate<rustc_lint[c11cb6a8cfa5f7c9]::BuiltinCombinedLateLintPass, rustc_interface[ceda1fd77ec39e1b]::passes::analysis::{closure#6}::{closure#1}::{closure#2}::{closure#0}::{closure#0}>::{closure#1}::{closure#0}::{closure#0}>::{closure#0}>
  28:     0x7f010ae3dd6e - <rustc_session[a360c2d099171c08]::session::Session>::time::<(), rustc_lint[c11cb6a8cfa5f7c9]::late::check_crate<rustc_lint[c11cb6a8cfa5f7c9]::BuiltinCombinedLateLintPass, rustc_interface[ceda1fd77ec39e1b]::passes::analysis::{closure#6}::{closure#1}::{closure#2}::{closure#0}::{closure#0}>::{closure#1}::{closure#0}>
  29:     0x7f010ae3d79f - <rustc_session[a360c2d099171c08]::session::Session>::time::<(), rustc_interface[ceda1fd77ec39e1b]::passes::analysis::{closure#6}::{closure#1}::{closure#2}::{closure#0}>
  30:     0x7f010ae3d418 - <core[2011dc7817943e09]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[ceda1fd77ec39e1b]::passes::analysis::{closure#6}::{closure#1}> as core[2011dc7817943e09]::ops::function::FnOnce<()>>::call_once
  31:     0x7f010ae3ce53 - <rustc_session[a360c2d099171c08]::session::Session>::time::<(), rustc_interface[ceda1fd77ec39e1b]::passes::analysis::{closure#6}>
  32:     0x7f010ae3b27a - rustc_interface[ceda1fd77ec39e1b]::passes::analysis
  33:     0x7f010c276a4c - rustc_query_system[f881c7f40ee7dcf0]::query::plumbing::try_execute_query::<rustc_query_impl[eb95ff51c492efdd]::queries::analysis, rustc_query_impl[eb95ff51c492efdd]::plumbing::QueryCtxt>
  34:     0x7f010c276740 - <rustc_query_impl[eb95ff51c492efdd]::Queries as rustc_middle[eaae5d2a0b8f0144]::ty::query::QueryEngine>::analysis
  35:     0x7f010c09f789 - <rustc_middle[eaae5d2a0b8f0144]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[74350ec99973fded]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>
  36:     0x7f010bc8ef08 - rustc_span[18b84908941c7cdf]::with_source_map::<core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>, rustc_interface[ceda1fd77ec39e1b]::interface::run_compiler<core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>, rustc_driver_impl[74350ec99973fded]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  37:     0x7f010bc8616c - std[1337fb43929788f1]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ceda1fd77ec39e1b]::util::run_in_thread_pool_with_globals<rustc_interface[ceda1fd77ec39e1b]::interface::run_compiler<core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>, rustc_driver_impl[74350ec99973fded]::run_compiler::{closure#1}>::{closure#0}, core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>
  38:     0x7f010bc85b9a - <<std[1337fb43929788f1]::thread::Builder>::spawn_unchecked_<rustc_interface[ceda1fd77ec39e1b]::util::run_in_thread_pool_with_globals<rustc_interface[ceda1fd77ec39e1b]::interface::run_compiler<core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>, rustc_driver_impl[74350ec99973fded]::run_compiler::{closure#1}>::{closure#0}, core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2011dc7817943e09]::result::Result<(), rustc_span[18b84908941c7cdf]::ErrorGuaranteed>>::{closure#1} as core[2011dc7817943e09]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  39:     0x7f0109773793 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7e0474dd3b8659fa
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/alloc/src/boxed.rs:1988:9
  40:     0x7f0109773793 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::heb8c41cf543a5c11
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/alloc/src/boxed.rs:1988:9
  41:     0x7f0109773793 - std::sys::unix::thread::Thread::new::thread_start::hc791abe67253fe06
                               at /rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/sys/unix/thread.rs:108:17
  42:     0x7f0109505bb5 - <unknown>
  43:     0x7f0109587d90 - <unknown>
  44:                0x0 - <unknown>

error: 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.70.0-nightly (22f247c6f 2023-03-13) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [lint_mod] linting top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
warning: 1 warning emitted

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. labels Mar 14, 2023
@compiler-errors
Copy link
Member

This broke in #107890, cc @obeis

@chenyukang chenyukang self-assigned this Mar 15, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Mar 15, 2023
…mpiler-errors

Fix MappingToUnit  to support no span of arg_ty

Fixes rust-lang#109152
@bors bors closed this as completed in b3af5e2 Mar 15, 2023
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Mar 15, 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. glacier ICE tracked in rust-lang/glacier. 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.

4 participants