Skip to content

-L and -o rustc arguments can be used unintuitively #142812

Open
@wesleywiser

Description

@wesleywiser

A developer reported that --emit mir wasn't creating a .mir file next to their source file:

$ rustc foobar.rs --emit mir -Cdebuginfo=2 -Csymbol-mangling-version -optimize -Ccodegen-units=1
$ ls
foobar.rs    ptimize

Obviously the issue is that -optimize is treated as -o ptimize but it would be nice if we could do something better here. -L has a similar kind of issue in that -Link-everything-statically is treated as -L ink-everything-statically but that one we could probe and issue a warning if the specified path doesn't exist.

One possibility might be to start issuing a warning (but never an error) if -o is specified without a space between the argument and the filename.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-CLIArea: Command-line interface (CLI) to the compilerA-diagnosticsArea: Messages for errors, warnings, and lintsT-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