Skip to content

Is rustc -o supposed to prescribe the *full* filename incl. extensions, or is it only supposed to describe the filename without extensions? #147403

@jieyouxu

Description

@jieyouxu

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-gnu produces foo.exe, but
  • On x86_64-pc-windows-msvc, rustc foo.rs -o foo --target=x86_64-pc-windows-msvc produces foo.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-windows-gnuToolchain: GNU, Operating system: WindowsO-windows-msvcToolchain: MSVC, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions