Skip to content

Make rustc careful about implicit overwrites #15240

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

Closed
natepisarski opened this issue Jun 28, 2014 · 1 comment
Closed

Make rustc careful about implicit overwrites #15240

natepisarski opened this issue Jun 28, 2014 · 1 comment

Comments

@natepisarski
Copy link

rustc currently overwrites source files without warning or failure if they do not have a file extension. For example rustc myfile succeeds without output, but is allowed to replace myfile with the binary output, deleting its contents.

@steveklabnik
Copy link
Member

dup of #13019

bors added a commit to rust-lang-ci/rust that referenced this issue Aug 21, 2023
…eykril

internal : rewrite DeMorgan assist

fixes rust-lang#15239 , rust-lang#15240 . This PR is a rewrite of the DeMorgan assist that essentially rids of all the string manipulation and modifies syntax trees to apply demorgan on a binary expr. The main reason for the rewrite is that I wanted to use `Expr::needs_parens_in` method to see if the expr on which the assist is applied would still need the parens it had once the parent expression's operator had equal precedence with that of the expression. I used `.clone_(subtree|for_update)` left and right and probably more than I should have, so I would also be happy to hear how I could have prevented redundant cloning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants