Skip to content

rustc -o - crashes #26719

Closed
Closed
@ghost

Description

When I tried this, I was hoping it would output the executable to stdout. Saving it as a file called - would be reasonable behavior too.

$ ls
example.rs
$ rustc -o - example.rs
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-m64" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "-" "-.o" "-Wl,--whole-archive" "-lmorestack" "-Wl,--no-whole-archive" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-7d23ff90.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-7d23ff90.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-7d23ff90.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-7d23ff90.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-7d23ff90.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-7d23ff90.rlib" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-7d23ff90.rlib" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/d/tmp/x/.rust/lib64/x86_64-unknown-linux-gnu" "-L" "/home/d/tmp/x/lib64/x86_64-unknown-linux-gnu" "-Wl,--whole-archive" "-Wl,-Bstatic" "-Wl,--no-whole-archive" "-Wl,-Bdynamic" "-ldl" "-lpthread" "-lrt" "-lgcc_s" "-lpthread" "-lc" "-lm" "-lcompiler-rt"
note: cc: error: unrecognized command line option ‘-.o’

error: aborting due to previous error
$ ls
example.rs  -.metadata.o  -.o

Metadata

Metadata

Assignees

Labels

A-frontendArea: Compiler frontend (errors, parsing and HIR)C-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions