Skip to content

It is not possible to compile a file named "rust.rs" on Linux #35887

Description

@c410-f3r

It is not possible to compile a file whose name is equal to a directory already created in the same folder:

$ rustc rust.rs
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "rust.0.o" "-o" "rust" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-39b92f95.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-39b92f95.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-39b92f95.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-39b92f95.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-39b92f95.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-39b92f95.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-39b92f95.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-39b92f95.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-39b92f95.rlib" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-39b92f95.rlib" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util" "-l" "compiler-rt"
note: /usr/bin/ld: cannot open output file rust: Is a directory
collect2: error: ld returned 1 exit status

error: aborting due to previous error

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions