-
Couldn't load subscription status.
- Fork 13.9k
Start using with_native_path in std::sys::fs
#138832
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
Conversation
This comment has been minimized.
This comment has been minimized.
98ace21 to
b7e9898
Compare
This comment has been minimized.
This comment has been minimized.
b7e9898 to
582d6ee
Compare
This comment has been minimized.
This comment has been minimized.
582d6ee to
265ee9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! If you want to convert some more functions here, that's fine with me, otherwise r=me
|
@bors r+ |
…boet Start using `with_native_path` in `std::sys::fs` Ideally, each platform should use their own native path type internally. This will, for example, allow passing a `CStr` directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated C string. However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this PR does some minimal refactoring which should help progress towards that goal. The changes are Unix-only and even then I avoided functions that require more changes so that this PR is just moving things around. r? joboet
Rollup of 8 pull requests Successful merges: - rust-lang#138692 (Reject `{true,false}` as revision names) - rust-lang#138757 (wasm: increase default thread stack size to 1 MB) - rust-lang#138832 (Start using `with_native_path` in `std::sys::fs`) - rust-lang#138988 (Change the syntax of the internal `weak!` macro) - rust-lang#139044 (bootstrap: Avoid cloning `change-id` list) - rust-lang#139056 (use `try_fold` instead of `fold`) - rust-lang#139057 (use `slice::contains` where applicable) - rust-lang#139086 (Various cleanup in ExprUseVisitor) r? `@ghost` `@rustbot` modify labels: rollup
265ee9c to
89c9c21
Compare
|
Just two minor fixes for platforms I missed (fuchsia and netbsd). |
|
@bors r=joboet |
…boet Start using `with_native_path` in `std::sys::fs` Ideally, each platform should use their own native path type internally. This will, for example, allow passing a `CStr` directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated C string. However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this PR does some minimal refactoring which should help progress towards that goal. The changes are Unix-only and even then I avoided functions that require more changes so that this PR is just moving things around. r? joboet
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#137928 (stabilize const_cell) - rust-lang#138431 (Fix `uclibc` LLVM target triples) - rust-lang#138832 (Start using `with_native_path` in `std::sys::fs`) - rust-lang#139060 (replace commit placeholder in vendor status with actual commit) - rust-lang#139081 (std: deduplicate `errno` accesses) - rust-lang#139100 (compiletest: Support matching diagnostics on lines below) - rust-lang#139105 (`BackendRepr::is_signed`: comment why this may panics) - rust-lang#139106 (Mark .pp files as Rust) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#137928 (stabilize const_cell) - rust-lang#138431 (Fix `uclibc` LLVM target triples) - rust-lang#138832 (Start using `with_native_path` in `std::sys::fs`) - rust-lang#139081 (std: deduplicate `errno` accesses) - rust-lang#139100 (compiletest: Support matching diagnostics on lines below) - rust-lang#139105 (`BackendRepr::is_signed`: comment why this may panics) - rust-lang#139106 (Mark .pp files as Rust) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#138832 - ChrisDenton:with_native_path, r=joboet Start using `with_native_path` in `std::sys::fs` Ideally, each platform should use their own native path type internally. This will, for example, allow passing a `CStr` directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated C string. However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this PR does some minimal refactoring which should help progress towards that goal. The changes are Unix-only and even then I avoided functions that require more changes so that this PR is just moving things around. r? joboet
…boet Start using `with_native_path` in `std::sys::fs` Ideally, each platform should use their own native path type internally. This will, for example, allow passing a `CStr` directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated C string. However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this PR does some minimal refactoring which should help progress towards that goal. The changes are Unix-only and even then I avoided functions that require more changes so that this PR is just moving things around. r? joboet
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#137928 (stabilize const_cell) - rust-lang#138431 (Fix `uclibc` LLVM target triples) - rust-lang#138832 (Start using `with_native_path` in `std::sys::fs`) - rust-lang#139081 (std: deduplicate `errno` accesses) - rust-lang#139100 (compiletest: Support matching diagnostics on lines below) - rust-lang#139105 (`BackendRepr::is_signed`: comment why this may panics) - rust-lang#139106 (Mark .pp files as Rust) r? `@ghost` `@rustbot` modify labels: rollup
…try> Use `with_native_path` for Windows Ideally, each platform should use their own native path type internally. This will, for example, allow passing a UTF-16 string directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated wide string. However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this just does some of the Windows parts. As with the previous Unix PR (rust-lang#138832) this is intended to be merely a refactoring so I've avoided anything that may require more substantial changes. try-job: x86_64-msvc-1
…=tgross35,joboet Use `with_native_path` for Windows Ideally, each platform should use their own native path type internally. This will, for example, allow passing a UTF-16 string directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated wide string. However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this just does some of the Windows parts. As with the previous Unix PR (rust-lang#138832) this is intended to be merely a refactoring so I've avoided anything that may require more substantial changes.
…=tgross35,joboet Use `with_native_path` for Windows Ideally, each platform should use their own native path type internally. This will, for example, allow passing a UTF-16 string directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated wide string. However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this just does some of the Windows parts. As with the previous Unix PR (rust-lang#138832) this is intended to be merely a refactoring so I've avoided anything that may require more substantial changes.
…=tgross35,joboet Use `with_native_path` for Windows Ideally, each platform should use their own native path type internally. This will, for example, allow passing a UTF-16 string directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated wide string. However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this just does some of the Windows parts. As with the previous Unix PR (rust-lang#138832) this is intended to be merely a refactoring so I've avoided anything that may require more substantial changes.
Rollup merge of rust-lang#139683 - ChrisDenton:windows-with-native, r=tgross35,joboet Use `with_native_path` for Windows Ideally, each platform should use their own native path type internally. This will, for example, allow passing a UTF-16 string directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated wide string. However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this just does some of the Windows parts. As with the previous Unix PR (rust-lang#138832) this is intended to be merely a refactoring so I've avoided anything that may require more substantial changes.
…=tgross35,joboet Use `with_native_path` for Windows Ideally, each platform should use their own native path type internally. This will, for example, allow passing a UTF-16 string directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated wide string. However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this just does some of the Windows parts. As with the previous Unix PR (rust-lang#138832) this is intended to be merely a refactoring so I've avoided anything that may require more substantial changes.
Ideally, each platform should use their own native path type internally. This will, for example, allow passing a
CStrdirectly tostd::fs::File::openand therefore avoid the need for allocating a new null-terminated C string.However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this PR does some minimal refactoring which should help progress towards that goal. The changes are Unix-only and even then I avoided functions that require more changes so that this PR is just moving things around.
r? joboet