You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PointerCast::ClosureFnPointer is unimplemented #274
// run-pass#![allow(unused_variables)]// Ensure that we deduce expected argument types when a `fn()` type is expected (#41755)fnfoo(f:fn(Vec<u32>) -> usize){}fnmain(){foo(|x| x.len())}
It looks like rustc reify the closure into FnOnce and pass the pointer to the call_once() implementation. Since this function doesn't capture anything, it doesn't pass Self as a parameter. We need to implement the reification.
Activity
avanhatt commentedon Jul 13, 2021
Also used in a Rust UI test:
src/test/ui/functions-closures/closure_to_fn_coercion-expected-types.rs
zhassan-aws commentedon Mar 15, 2022
The examples no longer crash, but keeping the issue open to track adding support for
PointerCast::ClosureFnPointer.YoshikiTakashima commentedon Sep 7, 2022
4/5 tests in
prost-typesfailing with this issue.celinval commentedon Nov 18, 2022
It looks like
rustcreify the closure intoFnOnceand pass the pointer to thecall_once()implementation. Since this function doesn't capture anything, it doesn't passSelfas a parameter. We need to implement the reification.rod-chapman commentedon Dec 13, 2022
I also get this unimplemented feature reported on s2n-quic/quic/s2n-quic-core/src/counter.rs
YoshikiTakashima commentedon Dec 16, 2022
@celinval Are you taking this on before Jan'23? I'm thinking of taking a stab at this issue since it looks pretty severe for
prost-types.P.S. 2023-01-06: No progress on this one. I got it drop
selfbut have not found a way to codegen that function so kani still fails to verify.celinval commentedon Jan 6, 2023
Ok. Let me take a look.