Is `rustc -o` supposed to prescribe the *full* filename incl. extensions, or is it only supposed to describe the filename without extensions?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
To me, both prescribes-full-filename or filename-without-extension effects make sense, but we should probably be consistent about this. It seems like
- On
x86_64-pc-windows-gnu,rustc foo.rs -o foo --target=x86_64-pc-windows-gnuproducesfoo.exe, but - On
x86_64-pc-windows-msvc,rustc foo.rs -o foo --target=x86_64-pc-windows-msvcproducesfoo.
I would've expected either both to have the .exe extension, or neither, but not differently? 🤔
I'm on a slightly older nightly toolchain; I don't remember seeing any recent changes surrounding this.
rustc 1.92.0-nightly (595b9a498 2025-10-03)
binary: rustc
commit-hash: 595b9a498bc55fcd30111e430d8e4290ed833b4c
commit-date: 2025-10-03
host: x86_64-pc-windows-msvc
release: 1.92.0-nightly
LLVM version: 21.1.2
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
Start at the rustc command behavior described for the x86_64-pc-windows-gnu and x86_64-pc-windows-msvc targets, reproducing both -o foo invocations. Determine the intended extension semantics and identify the relevant compiler entry point and regression coverage. Done means the behavior is consistent across these targets and the chosen semantics are verified by tests.
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
- Mostly clear
- Newbie friendliness
- 40/100