Skip to content

Don't give an error when creating a file for the first time - #80424

Merged
bors merged 1 commit into
rust-lang:masterfrom
jyn514:bootstrap-cleanup
Dec 31, 2020
Merged

Don't give an error when creating a file for the first time#80424
bors merged 1 commit into
rust-lang:masterfrom
jyn514:bootstrap-cleanup

Conversation

@jyn514

Copy link
Copy Markdown
Member

Previously, os.remove would always give a FileNotFound error the first
time you called it, causing bootstrap to make unnecessary copies. This
now only calls remove() if the file exists, avoiding the unnecessary
error.

This is a pretty small cleanup but I think it's useful. Taken from #79540.

Previously, `os.remove` would always give a FileNotFound error the first
time you called it, causing bootstrap to make unnecessary copies. This
now only calls `remove()` if the file exists, avoiding the unnecessary
error.
@jyn514jyn514 added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Dec 28, 2020
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 28, 2020
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Dec 29, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 7ac02bd has been approved by Mark-Simulacrum

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 29, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Dec 30, 2020
…mulacrum
Don't give an error when creating a file for the first time
Previously, `os.remove` would always give a FileNotFound error the first
time you called it, causing bootstrap to make unnecessary copies. This
now only calls `remove()` if the file exists, avoiding the unnecessary
error.
This is a pretty small cleanup but I think it's useful. Taken from rust-lang#79540.
@m-ou-sem-ou-se mentioned this pull request Dec 30, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 30, 2020
Rollup of 9 pull requests
Successful merges:
- rust-lang#78934 (refactor: removing library/alloc/src/vec/mod.rs ignore-tidy-filelength)
- rust-lang#79479 (Add `Iterator::intersperse`)
- rust-lang#80128 (Edit rustc_ast::ast::FieldPat docs)
- rust-lang#80424 (Don't give an error when creating a file for the first time)
- rust-lang#80458 (Some Promotion Refactoring)
- rust-lang#80488 (Do not create dangling &T in Weak<T>::drop)
- rust-lang#80491 (Miri: make size/align_of_val work for dangling raw ptrs)
- rust-lang#80495 (Rename kw::Invalid -> kw::Empty)
- rust-lang#80513 (Add regression test for rust-lang#80062)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 1975142 into rust-lang:masterDec 31, 2020
@rustbotrustbot added this to the 1.51.0 milestone Dec 31, 2020
@jyn514
jyn514 deleted the bootstrap-cleanup branch December 31, 2020 01:03
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cleanupCategory: PRs that clean code up or issues documenting cleanup.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@jyn514@rust-highfive@Mark-Simulacrum@bors@rustbot