-
Notifications
You must be signed in to change notification settings - Fork 92
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: Function call does not type check: #![feature(unboxed_closures/tuple_trait)] #2260
Comments
matthiaskrgr
changed the title
ICE: Function call does not type check: #![feature(unboxed_closures)]
ICE: Function call does not type check: #![feature(unboxed_closures/tuple_trait)]
Mar 2, 2023
I get a different error than originally reported: $ RUST_BACKTRACE=1 kani tuple_trait.rs
Kani Rust Verifier 0.37.0 (standalone)
thread 'rustc' panicked at kani-compiler/src/codegen_cprover_gotoc/codegen/typ.rs:271:13:
assertion failed: prev_args.len() == 1
stack backtrace:
0: rust_begin_unwind
at /rustc/65ea825f4021eaf77f1b25139969712d65b435a4/library/std/src/panicking.rs:619:5
1: core::panicking::panic_fmt
at /rustc/65ea825f4021eaf77f1b25139969712d65b435a4/library/core/src/panicking.rs:72:14
2: core::panicking::panic
at /rustc/65ea825f4021eaf77f1b25139969712d65b435a4/library/core/src/panicking.rs:127:5
3: kani_compiler::codegen_cprover_gotoc::codegen::typ::<impl kani_compiler::codegen_cprover_gotoc::context::goto_ctx::GotocCtx>::sig_with_untupled_args
at /kani/kani-compiler/src/codegen_cprover_gotoc/codegen/typ.rs:271:13
4: kani_compiler::codegen_cprover_gotoc::codegen::typ::<impl kani_compiler::codegen_cprover_gotoc::context::goto_ctx::GotocCtx>::fn_sig_of_instance
at /kani/kani-compiler/src/codegen_cprover_gotoc/codegen/typ.rs:410:28
5: kani_compiler::codegen_cprover_gotoc::context::current_fn::CurrentFnCtx::new
at /kani/kani-compiler/src/codegen_cprover_gotoc/context/current_fn.rs:48:18
6: kani_compiler::codegen_cprover_gotoc::context::goto_ctx::GotocCtx::set_current_fn
at /kani/kani-compiler/src/codegen_cprover_gotoc/context/goto_ctx.rs:305:32
7: kani_compiler::codegen_cprover_gotoc::codegen::function::<impl kani_compiler::codegen_cprover_gotoc::context::goto_ctx::GotocCtx>::declare_function
at /kani/kani-compiler/src/codegen_cprover_gotoc/codegen/function.rs:227:9
8: kani_compiler::codegen_cprover_gotoc::compiler_interface::GotocCodegenBackend::codegen_items::{{closure}}::{{closure}}
at /kani/kani-compiler/src/codegen_cprover_gotoc/compiler_interface.rs:104:39
9: kani_compiler::codegen_cprover_gotoc::utils::debug::<impl kani_compiler::codegen_cprover_gotoc::context::goto_ctx::GotocCtx>::call_with_panic_debug_info::{{closure}}
at /kani/kani-compiler/src/codegen_cprover_gotoc/utils/debug.rs:68:13
10: std::thread::local::LocalKey<T>::try_with
at /rustc/65ea825f4021eaf77f1b25139969712d65b435a4/library/std/src/thread/local.rs:270:16
11: std::thread::local::LocalKey<T>::with
at /rustc/65ea825f4021eaf77f1b25139969712d65b435a4/library/std/src/thread/local.rs:246:9
12: kani_compiler::codegen_cprover_gotoc::utils::debug::<impl kani_compiler::codegen_cprover_gotoc::context::goto_ctx::GotocCtx>::call_with_panic_debug_info
at /kani/kani-compiler/src/codegen_cprover_gotoc/utils/debug.rs:65:9
13: kani_compiler::codegen_cprover_gotoc::compiler_interface::GotocCodegenBackend::codegen_items::{{closure}}
at /kani/kani-compiler/src/codegen_cprover_gotoc/compiler_interface.rs:103:29
14: kani_compiler::codegen_cprover_gotoc::compiler_interface::with_timer
at /kani/kani-compiler/src/codegen_cprover_gotoc/compiler_interface.rs:752:15
15: kani_compiler::codegen_cprover_gotoc::compiler_interface::GotocCodegenBackend::codegen_items
at /kani/kani-compiler/src/codegen_cprover_gotoc/compiler_interface.rs:97:9
16: <kani_compiler::codegen_cprover_gotoc::compiler_interface::GotocCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
at /kani/kani-compiler/src/codegen_cprover_gotoc/compiler_interface.rs:243:25
17: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
18: rustc_interface::passes::start_codegen
19: <rustc_middle::ty::context::GlobalCtxt>::enter::<<rustc_interface::queries::Queries>::ongoing_codegen::{closure#0}, core::result::Result<alloc::boxed::Box<dyn core::any::Any>, rustc_span::ErrorGuaranteed>>
20: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Kani unexpectedly panicked during compilation.
Please file an issue here: https://github.com/model-checking/kani/issues/new?labels=bug&template=bug_report.md
[Kani] current codegen item: declare_function: foo::<()>
[Kani] current codegen location: Loc { file: "/tmp/tuple_trait.rs", function: None, start_line: 3, start_col: Some(1), end_line: 3, end_col: Some(55) } |
This seems related to the "rust-call" ABI handling. Using arguments also triggers the issue I mentioned above: extern "rust-call" fn equal<T, U>(args: (T, U)) -> bool
where
T: PartialEq<U>,
{
args.0 == args.1
}
#[kani::proof]
fn check_empty() {
let input: u8 = kani::any();
assert!(equal((input, input)));
} |
Ah yes I also get that now, maybe I just accidentally copied a wrong stacktrace. |
celinval
added a commit
that referenced
this issue
Feb 6, 2024
Use FnAbi instead of function signature when generating code for function types. Properly check the `PassMode::Ignore`. For foreign functions, instead of ignoring the declaration type, cast the arguments and return value. For now, we also ignore the caller location, since we don't currently support tracking caller location. This change makes it easier for us to do so. We might want to wait for this issue to get fixed so we can easily add support using stable APIs: rust-lang/project-stable-mir#62 Resolves #2260 Resolves #2312 Resolves #1365 Resolves #1350
feliperodri
added a commit
that referenced
this issue
Feb 9, 2024
## What's Changed * `modifies` Clauses for Function Contracts by @JustusAdam in #2800 * Fix ICEs due to mismatched arguments by @celinval in #2994. Resolves the following issues: * #2260 * #2312 * Enable powf*, exp*, log* intrinsics by @tautschnig in #2996 * Upgrade Rust toolchain to nightly-2024-01-24 by @celinval @feliperodri @qinheping **Full Changelog**: kani-0.45.0...kani-0.46.0 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. --------- Signed-off-by: Felipe R. Monteiro <felisous@amazon.com> Co-authored-by: Celina G. Val <celinval@amazon.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried this code:
using the following command line invocation:
with Kani version: 0.22.0
I expected to see this happen: explanation
Instead, this happened: explanation
The text was updated successfully, but these errors were encountered: