Closed kkysen closed 1 year ago
Can you be more specific about what "doesn't work" means? Error messages would be helpful
Yeah, I'll add them.
Hmm, it seems that now use std::ptr::addr_of; addr_of!(x);
works? In a new, separate test from master
, but I don't think I touched anything related.
During rewriting,
std::ptr::addr_of!
seems to be special cased to an extent, as some other equivalent forms do not work. Specifically, these work:std::ptr::addr_of!
::std::ptr::addr_of!
use std::ptr::addr_of
,addr_of!
This one wasn't working previously, but seems to be working now. It may be finicky.core::ptr::addr_of!
::core::ptr::addr_of!
use core::ptr::addr_of
,addr_of!
See also https://github.com/immunant/c2rust/blob/11bf3514929133cd5ee44fe4eb5956bb0e4c07e8/c2rust-analyze/tests/analyze/string_casts.rs#L18-L21
There doesn't appear to be a specific error. Instead, this is printed: