-
Notifications
You must be signed in to change notification settings - Fork 13.7k
std: clarify OpenOptions
error for create without write access
#144964
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
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
|
oops somehow i've untracked remote master, will rebase rn. Sorry |
9332c13
to
0760151
Compare
This comment has been minimized.
This comment has been minimized.
0760151
to
dd1bb0f
Compare
This comment has been minimized.
This comment has been minimized.
dd1bb0f
to
f82e9ca
Compare
This comment has been minimized.
This comment has been minimized.
f82e9ca
to
de61934
Compare
@ibraheemdev friendly ping :) |
Do the tests pass before applying this change (is this a change in behavior)? |
I've only changed the error message; the behavior is the same. You can't do anything meaningful when setting these flags, except trigger a validation error. With my changes, you still get a validation error as before, but now it tells you what’s wrong instead of making you open strace/gdb :) |
I'm slightly concerned about keeping the message consistent across platforms, but we seem to do the same thing for other error conditions, so this seems fine. @bors r+ rollup |
…aheemdev std: clarify `OpenOptions` error for create without write access Fixes rust-lang#140621
…aheemdev std: clarify `OpenOptions` error for create without write access Fixes rust-lang#140621
…aheemdev std: clarify `OpenOptions` error for create without write access Fixes rust-lang#140621
Rollup of 6 pull requests Successful merges: - #144964 (std: clarify `OpenOptions` error for create without write access) - #145242 (std: use a TAIT to define `SplitPaths` on UNIX) - #145467 (Stabilize `strict_provenance_atomic_ptr` feature) - #145990 (`AutoDeref::final_ty` is already resolved) - #145991 (std: haiku: fix `B_FIND_PATH_IMAGE_PATH`) - #146000 (Improve librustdoc error when a file creation/modification failed) r? `@ghost` `@rustbot` modify labels: rollup
…aheemdev std: clarify `OpenOptions` error for create without write access Fixes rust-lang#140621
…aheemdev std: clarify `OpenOptions` error for create without write access Fixes rust-lang#140621
Think this may have failed #146014 (comment) @bors r- |
This comment has been minimized.
This comment has been minimized.
std: clarify `OpenOptions` error for create without write access try-job: aarch64-msvc-1
This comment has been minimized.
This comment has been minimized.
💔 Test for 4d9eaea failed: CI. Failed jobs:
|
de61934
to
e2afa2a
Compare
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Previously, attempting to create/truncate a file without write/append access would result in platform-specific error messages: - Unix: "Invalid argument" - Windows: raw OS error code 87 These error codes look like system errors, which could waste hours of debugging for what is actually an API misuse issue.
e2afa2a
to
0858b14
Compare
it failed because of different rust/library/std/src/fs/tests.rs Lines 48 to 64 in 846e377
Now i directly use |
@bors2 try jobs=aarch64-msvc-1 |
@0xdeafbeef: 🔑 Insufficient privileges: not in try users |
@tgross35 can you trigger windows build? should pass now |
@bors2 try jobs=aarch64-msvc-1 |
This comment has been minimized.
This comment has been minimized.
std: clarify `OpenOptions` error for create without write access try-job: aarch64-msvc-1
@bors r=ibraheemdev |
Rollup of 4 pull requests Successful merges: - #144964 (std: clarify `OpenOptions` error for create without write access) - #146030 (Fix `sys::process::windows::tests::test_thread_handle` spurious failure) - #146035 (Update `browser-ui-test` version to `0.21.3`) - #146036 (Use move_file for rename in tracing) r? `@ghost` `@rustbot` modify labels: rollup
Fixes #140621