#![no_main] breaks compiling with --test
Open
Nobody has claimed this yet.
A-libtest
C-bug
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this code:
See title
I expected to see this happen: #![no_main] gets ignored as libtest can't possibly work with it.
Instead, this happened: A linker error complaining that main doesn't exist.
Meta
Someone hit this at https://users.rust-lang.org/t/error-when-testing-library/125842
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or compiler entry points are named. Reproduce the reported combination of --test and #![no_main], then trace how it reaches the linker; done means the case no longer fails because main is missing and has regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100