compiler-explorer / compiler-explorer/compiler-explorer
Change crate-type when linking to bin
Open
lang-rust
request
- Dominant language
- TypeScript
- Stars
- 19.1k
- Forks
- 2.1k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 67
Description
When there is a `fn main()`, it would be better to use `--crate-type bin` instead of `--crate-type lib`. This would avoid having to make `main` explicitly public to stop the compiler from gc-ing it. That's what rust playground is doing (thanks @bjorn3 for the hint)
Contributor guide
Assessment
This issue has not been assessed yet.