gccrs: track abi and unsafety on fnptrs for proper type checking
We need to distinguish between abi's and unsafety on fnptrs. There is
a commented out check because there is a regression in:
rust/compile/try-catch-unwind-{new/old}.rs
But i think this is because the test case should be taking an FnOnce
from reading std::panic in rust 1.49. Where as we are passing an fnptr
which is probably because we didnt support fnonce at all then.
Addresses Rust-GCC/gccrs#4090
gcc/rust/ChangeLog:
* hir/tree/rust-hir-item.h: add unsafe helper
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): pass in abi and unsafe
* typecheck/rust-tyty.cc (BaseType::monomorphized_clone): likewise
(FnPtr::as_string): emit more info
(FnPtr::clone): update ctor call
* typecheck/rust-tyty.h: new ctor params
* typecheck/rust-unify.cc (UnifyRules::expect_fnptr): check abi and unsafe
Signed-off-by: Philip Herron <herron.philip@googlemail.com>