We were using the DECL_RESULT but this just contains the TREE_TYPE of the
retval. It was also missing taking the address of the destination for the
memset call. This changes the code to create a temp variable for the return
value and asserts the destination size is the same as the size of the
template param.
Fixes #2583
gcc/rust/ChangeLog:
* backend/rust-compile-intrinsic.cc (enter_intrinsic_block): take the locals vector
(uninit_handler): make a temp variable and use the address of it
gcc/testsuite/ChangeLog:
* rust/execute/torture/issue-2583.rs: New test.
Signed-off-by: Philip Herron <herron.philip@googlemail.com>