-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It is not possible to compile a file named "rust.rs" on Linux #35887
Comments
Not really a rust bug.
|
@durka Guess it is not a bug after all |
You cannot have both a file and a directory with the exact same name in the same directory. |
There could be a nicer error message to indicate to the user that there is a directory with the same name as the program. |
FWIW, $ ls
$ echo "int main() { return 0; }" > a.c
$ mkdir a.out
$ ls
a.c a.out
$ gcc a.c
/usr/bin/ld: cannot open output file a.out: Is a directory
collect2: error: ld returned 1 exit status
$ |
I could expand #34005 when I get back to it to clean it up to pick this case up as well. |
Ah yes I think this is "not a bug" where we can't create executables with a directory of the same name, so closing. |
When the compiled executable would conflict with a directory, display a rustc error instead of a verbose and potentially-confusing linker error. This is a usability improvement, and doesn’t actually change behaviour with regards to compilation success. This addresses the concern in rust-lang#35887.
Just to note: this is a duplicate of #13098. |
…y, r=estebank Warn when rustc output conflicts with existing directories When the compiled executable would conflict with a directory, display a rustc error instead of a verbose and potentially-confusing linker error. This is a usability improvement, and doesn’t actually change behaviour with regards to compilation success. This addresses the concern in #35887. Fixes #13098.
…y, r=estebank Warn when rustc output conflicts with existing directories When the compiled executable would conflict with a directory, display a rustc error instead of a verbose and potentially-confusing linker error. This is a usability improvement, and doesn’t actually change behaviour with regards to compilation success. This addresses the concern in #35887. Fixes #13098.
It is not possible to compile a file whose name is equal to a directory already created in the same folder:
The text was updated successfully, but these errors were encountered: