Skip to content
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

Document that create_dir_all calls mkdir/CreateDirW multiple times #124520

Merged
merged 1 commit into from May 6, 2024

Conversation

tbu-
Copy link
Contributor

@tbu- tbu- commented Apr 29, 2024

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Apr 29, 2024

r? @Amanieu

rustbot has assigned @Amanieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 29, 2024
@the8472
Copy link
Member

the8472 commented Apr 29, 2024

How do those details help the reader?

@tbu-
Copy link
Contributor Author

tbu- commented Apr 29, 2024

It's not a single syscall that makes this function work, but additional logic on top of it. That's interesting for the user of this function.

@the8472
Copy link
Member

the8472 commented Apr 29, 2024

We don't document all the functions that happen to do more than 1 syscall. So, again, why is that interesting to the user? How does it help them to use it?

@tbu-
Copy link
Contributor Author

tbu- commented Apr 29, 2024

It's interesting in that it's non-atomic. In the error case, there might be partial directory structures lying around.

We don't document all the functions that happen to do more than 1 syscall.

Can you give an example of a function that documents which syscall it corresponds to, but uses it multiple times without documenting it?

@the8472
Copy link
Member

the8472 commented Apr 29, 2024

It's interesting in that it's non-atomic. In the error case, there might be partial directory structures lying around.

Then the docs should say that, rather then trying to say that through the implementation details.

Can you give an example of a function that documents which syscall it corresponds to, but uses it multiple times without documenting it?

Eh, most docs aren't even that precise. fs::copy says which syscalls it uses but not how often.

@tbu-
Copy link
Contributor Author

tbu- commented Apr 29, 2024

It's interesting in that it's non-atomic. In the error case, there might be partial directory structures lying around.

Then the docs should say that, rather then trying to say that through the implementation details.

Before I'll try to do that: Are you opposed to also mentioning that it's using multiple calls to mkdir instead of just one, in the implementation details? I'll remove the longer explanation of how the multiple calls are issued.

@the8472
Copy link
Member

the8472 commented Apr 29, 2024

Using a plural is fine. Explaining the traversal order seems unnecessary to me.

Also mention that there might be leftover directories in the error case.
@Amanieu
Copy link
Member

Amanieu commented May 6, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 6, 2024

📌 Commit a0f8ada has been approved by Amanieu

It is now in the queue for this repository.

@bors bors 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 May 6, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 6, 2024
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#124520 (Document that `create_dir_all` calls `mkdir`/`CreateDirW` multiple times)
 - rust-lang#124724 (Prefer lower vtable candidates in select in new solver)
 - rust-lang#124771 (Don't consider candidates with no failing where clauses when refining obligation causes in new solver)
 - rust-lang#124808 (Use `super_fold` in `RegionsToStatic` visitor)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 44cbf7d into rust-lang:master May 6, 2024
9 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 6, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 6, 2024
Rollup merge of rust-lang#124520 - tbu-:pr_create_dir_all_doc, r=Amanieu

Document that `create_dir_all` calls `mkdir`/`CreateDirW` multiple times
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants