-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
rustc overwrites input file when it has no extension #13019
Comments
If/when #9826 gets implemented, it'll make sense to have an extension-less Rust file. I'm not sure where |
Will simply failing if the input file has no extension fix the issue? |
Triage: this still happens today. |
This still happens
|
We just had 2 new Rust learners hit this... |
It's still an issue with rustc 1.18.0-nightly (28a7429 2017-04-13) |
@estebank: I have a fix for this, based on your patch — are you happy for me to submit it, or would you like to finish it off? |
@varkor feel free to go ahead and submit the PR. Thank you for picking this up! |
If rustc is invoked on a file that would be overwritten by the compilation, the compilation now fails, to avoid accidental loss. This resolves rust-lang#13019.
Prevent rustc overwriting input files If rustc is invoked on a file that would be overwritten by the compilation, the compilation now fails, to avoid accidental loss. This resolves rust-lang#13019. Kudos to @estebank, whose patch I finished off.
Tested on OS X, af93684. Not that it makes sense to write Rust files with no extension, but if you do, rustc should not overwrite the input file by default.
The text was updated successfully, but these errors were encountered: