rust-playground icon indicating copy to clipboard operation
rust-playground copied to clipboard

main() detection doesn't catch a manually defined `extern "C" fn main()`

Open abonander opened this issue 5 years ago • 0 comments

Playground doesn't detect that the following code has a main() function:

#![no_main]

use std::os::raw::*;

#[no_mangle]
pub extern "C" fn main(argc: c_int, argv: *const *mut c_char) -> c_int {
    println!("Hello from main({}, {:p})", argc, argv);
    0
}

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=736713393bf0a8b9cb307dcc5a46fdc4

This is a pretty niche edge case, so feel free to close this if you don't think it's worth the effort. I didn't see anything mentioning this specific case in the issue tracker so I figured I'd report it.

abonander avatar Oct 06 '20 03:10 abonander