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: effects: is not fully resolved #115791

Closed
matthiaskrgr opened this issue Sep 12, 2023 · 1 comment · Fixed by #115859
Closed

ICE: effects: is not fully resolved #115791

matthiaskrgr opened this issue Sep 12, 2023 · 1 comment · Fixed by #115859
Assignees
Labels
C-bug Category: This is a bug. F-effects `#![feature(effects)]` 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

#![feature(effects)]

const fn foo(n: i32) -> i32 {
    n
}

const fn return_ty_mismatch() {
    const_eval_select((1,), foo, bar);
}

Meta

rustc --version --verbose:

rustc 1.74.0-nightly (5f6ee65f5 2023-09-12)
binary: rustc
commit-hash: 5f6ee65f594f59f64c7957dcad90edc0b8830284
commit-date: 2023-09-12
host: x86_64-unknown-linux-gnu
release: 1.74.0-nightly
LLVM version: 17.0.0

Error output

error[E0425]: cannot find function `const_eval_select` in this scope
 --> const-eval-select-bad.rs:8:5
  |
8 |     const_eval_select((1,), foo, bar);
  |     ^^^^^^^^^^^^^^^^^ not found in this scope
  |
help: consider importing this function
  |
3 + use std::intrinsics::const_eval_select;
  |

error[E0425]: cannot find value `bar` in this scope
 --> const-eval-select-bad.rs:8:34
  |
8 |     const_eval_select((1,), foo, bar);
  |                                  ^^^ not found in this scope

error[E0601]: `main` function not found in crate `const_eval_select_bad`
 --> const-eval-select-bad.rs:9:2
  |
9 | }
  |  ^ consider adding a `main` function to `const-eval-select-bad.rs`
Backtrace

thread 'rustc' panicked at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/compiler/rustc_infer/src/infer/mod.rs:1422:9:
`Ok(FnDef(DefId(0:3 ~ const_eval_select_bad[e67f]::foo), [Const { ty: bool, kind: ?0e }]))` is not fully resolved
stack backtrace:
   0:     0x7fc776335efc - std::backtrace_rs::backtrace::libunwind::trace::h170ba77b7937dfc1
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fc776335efc - std::backtrace_rs::backtrace::trace_unsynchronized::ha3ffdef167b36dcf
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fc776335efc - std::sys_common::backtrace::_print_fmt::h3593f75d449d7c19
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7fc776335efc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3d681876fb1a0c35
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fc77639c15c - core::fmt::rt::Argument::fmt::h28dae40336be117d
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/core/src/fmt/rt.rs:138:9
   5:     0x7fc77639c15c - core::fmt::write::hc7ede5ba8d1b34fc
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/core/src/fmt/mod.rs:1094:21
   6:     0x7fc77632893e - std::io::Write::write_fmt::h4b5cbdfd5c06e4d9
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/std/src/io/mod.rs:1714:15
   7:     0x7fc776335ce4 - std::sys_common::backtrace::_print::hf9f8d894d0fba8f4
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fc776335ce4 - std::sys_common::backtrace::print::h6736ec2ce0b1565d
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fc776338dda - std::panicking::panic_hook_with_disk_dump::{{closure}}::h23059af5ca98b58a
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/std/src/panicking.rs:280:22
  10:     0x7fc776338ad5 - std::panicking::panic_hook_with_disk_dump::h6a2d92a5ff298e6f
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/std/src/panicking.rs:314:9
  11:     0x7fc775151e49 - rustc_driver_impl[f8442aae50b2ebe1]::install_ice_hook::{closure#0}
  12:     0x7fc776339693 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h34ea97e0bbf89982
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/alloc/src/boxed.rs:2021:9
  13:     0x7fc776339693 - std::panicking::rust_panic_with_hook::h71b4835249b93020
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/std/src/panicking.rs:757:13
  14:     0x7fc776339411 - std::panicking::begin_panic_handler::{{closure}}::haf0bd6f65b167fe9
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/std/src/panicking.rs:631:13
  15:     0x7fc776336426 - std::sys_common::backtrace::__rust_end_short_backtrace::hec6b1c9c3aaa2fc0
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/std/src/sys_common/backtrace.rs:170:18
  16:     0x7fc776339152 - rust_begin_unwind
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/std/src/panicking.rs:619:5
  17:     0x7fc776398505 - core::panicking::panic_fmt::hfe421f38e4eebe22
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/core/src/panicking.rs:72:14
  18:     0x7fc77334e6c3 - <rustc_hir_typeck[96f43ef1f9ed4f24]::writeback::WritebackCx as rustc_hir[f0f1005e0ab084e1]::intravisit::Visitor>::visit_expr
  19:     0x7fc77334c5d2 - <rustc_hir_typeck[96f43ef1f9ed4f24]::writeback::WritebackCx as rustc_hir[f0f1005e0ab084e1]::intravisit::Visitor>::visit_expr
  20:     0x7fc773356d7b - <rustc_hir_typeck[96f43ef1f9ed4f24]::writeback::WritebackCx as rustc_hir[f0f1005e0ab084e1]::intravisit::Visitor>::visit_block
  21:     0x7fc77334c615 - <rustc_hir_typeck[96f43ef1f9ed4f24]::writeback::WritebackCx as rustc_hir[f0f1005e0ab084e1]::intravisit::Visitor>::visit_expr
  22:     0x7fc7741f50e4 - <rustc_hir_typeck[96f43ef1f9ed4f24]::fn_ctxt::FnCtxt>::resolve_type_vars_in_body
  23:     0x7fc7741e40a2 - rustc_hir_typeck[96f43ef1f9ed4f24]::typeck
  24:     0x7fc77324f64e - rustc_query_impl[5d5a3cff05f7bed8]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5d5a3cff05f7bed8]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[b639b8b23e8d3436]::query::erase::Erased<[u8; 8usize]>>
  25:     0x7fc77324f61e - <rustc_query_impl[5d5a3cff05f7bed8]::query_impl::typeck::dynamic_query::{closure#2} as core[8975a1ebd15850b5]::ops::function::FnOnce<(rustc_middle[b639b8b23e8d3436]::ty::context::TyCtxt, rustc_span[319b9c0a2f58e367]::def_id::LocalDefId)>>::call_once
  26:     0x7fc773347498 - rustc_query_system[50f896f966c25655]::query::plumbing::try_execute_query::<rustc_query_impl[5d5a3cff05f7bed8]::DynamicConfig<rustc_query_system[50f896f966c25655]::query::caches::VecCache<rustc_span[319b9c0a2f58e367]::def_id::LocalDefId, rustc_middle[b639b8b23e8d3436]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[5d5a3cff05f7bed8]::plumbing::QueryCtxt, false>
  27:     0x7fc774ad7b21 - rustc_query_impl[5d5a3cff05f7bed8]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  28:     0x7fc77431fcdf - rustc_data_structures[cb81a686e7cdb45e]::sync::parallel::disabled::par_for_each_in::<&[rustc_span[319b9c0a2f58e367]::def_id::LocalDefId], <rustc_middle[b639b8b23e8d3436]::hir::map::Map>::par_body_owners<rustc_hir_analysis[788a263b067e3e39]::check_crate::{closure#7}>::{closure#0}>
  29:     0x7fc77431e9c8 - rustc_hir_analysis[788a263b067e3e39]::check_crate
  30:     0x7fc774315252 - rustc_interface[afabc26049662c5e]::passes::analysis
  31:     0x7fc77459f46a - rustc_query_impl[5d5a3cff05f7bed8]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5d5a3cff05f7bed8]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[b639b8b23e8d3436]::query::erase::Erased<[u8; 1usize]>>
  32:     0x7fc77459f459 - <rustc_query_impl[5d5a3cff05f7bed8]::query_impl::analysis::dynamic_query::{closure#2} as core[8975a1ebd15850b5]::ops::function::FnOnce<(rustc_middle[b639b8b23e8d3436]::ty::context::TyCtxt, ())>>::call_once
  33:     0x7fc774885174 - rustc_query_system[50f896f966c25655]::query::plumbing::try_execute_query::<rustc_query_impl[5d5a3cff05f7bed8]::DynamicConfig<rustc_query_system[50f896f966c25655]::query::caches::SingleCache<rustc_middle[b639b8b23e8d3436]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[5d5a3cff05f7bed8]::plumbing::QueryCtxt, false>
  34:     0x7fc774884ee9 - rustc_query_impl[5d5a3cff05f7bed8]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  35:     0x7fc77466ac13 - <rustc_middle[b639b8b23e8d3436]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[f8442aae50b2ebe1]::run_compiler::{closure#1}::{closure#2}::{closure#6}, core[8975a1ebd15850b5]::result::Result<(), rustc_span[319b9c0a2f58e367]::ErrorGuaranteed>>
  36:     0x7fc774669d08 - <rustc_interface[afabc26049662c5e]::interface::Compiler>::enter::<rustc_driver_impl[f8442aae50b2ebe1]::run_compiler::{closure#1}::{closure#2}, core[8975a1ebd15850b5]::result::Result<core[8975a1ebd15850b5]::option::Option<rustc_interface[afabc26049662c5e]::queries::Linker>, rustc_span[319b9c0a2f58e367]::ErrorGuaranteed>>
  37:     0x7fc774662fd4 - std[ba7dab7da19e8c24]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[afabc26049662c5e]::util::run_in_thread_with_globals<rustc_interface[afabc26049662c5e]::interface::run_compiler<core[8975a1ebd15850b5]::result::Result<(), rustc_span[319b9c0a2f58e367]::ErrorGuaranteed>, rustc_driver_impl[f8442aae50b2ebe1]::run_compiler::{closure#1}>::{closure#0}, core[8975a1ebd15850b5]::result::Result<(), rustc_span[319b9c0a2f58e367]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8975a1ebd15850b5]::result::Result<(), rustc_span[319b9c0a2f58e367]::ErrorGuaranteed>>
  38:     0x7fc77466272e - <<std[ba7dab7da19e8c24]::thread::Builder>::spawn_unchecked_<rustc_interface[afabc26049662c5e]::util::run_in_thread_with_globals<rustc_interface[afabc26049662c5e]::interface::run_compiler<core[8975a1ebd15850b5]::result::Result<(), rustc_span[319b9c0a2f58e367]::ErrorGuaranteed>, rustc_driver_impl[f8442aae50b2ebe1]::run_compiler::{closure#1}>::{closure#0}, core[8975a1ebd15850b5]::result::Result<(), rustc_span[319b9c0a2f58e367]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8975a1ebd15850b5]::result::Result<(), rustc_span[319b9c0a2f58e367]::ErrorGuaranteed>>::{closure#1} as core[8975a1ebd15850b5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  39:     0x7fc776344075 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf087c3a953991192
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/alloc/src/boxed.rs:2007:9
  40:     0x7fc776344075 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h911ae42726efeb98
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/alloc/src/boxed.rs:2007:9
  41:     0x7fc776344075 - std::sys::unix::thread::Thread::new::thread_start::hb163d3257e70a2e6
                               at /rustc/b4e54c6e39984840a04dcd02d14ec8c3574d30e5/library/std/src/sys/unix/thread.rs:108:17
  42:     0x7fc771c8c9eb - <unknown>
  43:     0x7fc771d10dfc - <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: please attach the file at `/tmp/im/icemaker_reduced/rustc-ice-2023-09-12T16:29:00.161643674Z-2972167.txt` to your bug report

query stack during panic:
#0 [typeck] type-checking `return_ty_mismatch`
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0425, E0601.
For more information about an error, try `rustc --explain E0425`.

@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. F-effects `#![feature(effects)]` labels Sep 12, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 12, 2023
@matthiaskrgr
Copy link
Member Author

Regression in nightly-2023-09-12
Regression in 0a199e4
#115727

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 12, 2023
@compiler-errors compiler-errors self-assigned this Sep 14, 2023
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 15, 2023
…ee1-dead

Fallback effects even if types also fallback

`||` is short circuiting, so if we do ty/int var fallback, we *don't* do effect fallback 😸

r? `@fee1-dead` or `@oli-obk`

Fixes rust-lang#115791
Fixes rust-lang#115842
@bors bors closed this as completed in ae9465f Sep 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. F-effects `#![feature(effects)]` 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