Don't generate #[main]
and #![feature(main)]
as it was removed
#678
Labels
bug
Something isn't working
When the C
main
function is notint main()
(such asvoid main()
),c2rust transpile
marks the transpiledfn main
as#[main]
and adds#![feature(main)]
to the file. However,#[main]
and#![feature(main)]
have been removed in Rust for a while now since 2017 (in rust-lang/rust#29634) and are now both errors. We should stop emitting both of these. Given Rust no longer supports it, I don't think we should try to support non-standardmain
functions in C, which are implementation-defined anyways. In the specific case ofvoid main()
from #661, as well as other signatures that returnvoid
instead ofint
, we could still support them by just returning()
fromfn main
.The text was updated successfully, but these errors were encountered: