mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
dda4963edb
Implement create_dir_all() to operate iteratively instead of recursively The current implementation of `create_dir_all(...)` in std::fs operates recursively. As mentioned in rust-lang/rust#124309, this could run into a stack overflow with big paths. To avoid this stack overflow issue, this PR implements the method in an iterative manner, preserving the documented behavior of: ``` Recursively create a directory and all of its parent components if they are missing. This function is not atomic. If it returns an error, any parent components it was able to create will remain. If the empty path is passed to this function, it always succeeds without creating any directories. ```