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
I'd expect function pointers (fn() with all combinations of safety and ABI) to implement roughly the same set of traits as raw pointers, namely: PartialEq, Eq, Clone, PartialOrd, Ord, Hash, fmt::Pointer, Debug
Currently Clone is implemented for safe and unsafe function pointers, but all the ABIs except for "Rust" and "C" are ignored, i.e. a paradoxical situation takes place - extern "rare_abi" fn() is Copy, but not Clone (Edit: and it causes ICEs). PartialEq is implemented only for safe function pointers with "C" ABI.
All the other traits are not implemented.
The text was updated successfully, but these errors were encountered:
See also #24000 -- fn() types are also further parameterized by their number of lifetime parameters unfortunately, so it's very hard to cover even all possibilities of regular rust ABI functions.
I'd expect function pointers (
fn()
with all combinations of safety and ABI) to implement roughly the same set of traits as raw pointers, namely:PartialEq
,Eq
,Clone
,PartialOrd
,Ord
,Hash
,fmt::Pointer
,Debug
Currently
Clone
is implemented for safe and unsafe function pointers, but all the ABIs except for "Rust" and "C" are ignored, i.e. a paradoxical situation takes place -extern "rare_abi" fn()
isCopy
, but notClone
(Edit: and it causes ICEs).PartialEq
is implemented only for safe function pointers with "C" ABI.All the other traits are not implemented.
The text was updated successfully, but these errors were encountered: