| Age | Commit message (Collapse) | Author | Lines |
|
For the zkVM, even when a guest buffer is uninitialized, from the host's
perspective it is just a normal piece of memory which was initialized
before letting the guest write into it. This makes `sys_read` safe to
use with an uninitialized buffer. See
https://github.com/risc0/risc0/issues/2853.
|
|
Fix `*-win7-windows-msvc` target since 26eeac1a1e9fe46ffd80dd0d3dafdd2c2a644306
That commit make it failed to build `std` with `*-win7-windows-msvc` so fix it.
|
|
|
|
|
|
Since commit https://github.com/aosp-mirror/platform_frameworks_base/commit/d5ccb038f69193fb63b5169d7adc5da19859c9d8, `TMPDIR` will be set to application's cache dir when app starts.
|
|
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #120580 (Add `MAX_LEN_UTF8` and `MAX_LEN_UTF16` Constants)
- #132268 (Impl TryFrom<Vec<u8>> for String)
- #136093 (Match Ergonomics 2024: update old-edition behavior of feature gates)
- #136344 (Suggest replacing `.` with `::` in more error diagnostics.)
- #136690 (Use more explicit and reliable ptr select in sort impls)
- #136815 (CI: Stop /msys64/bin from being prepended to PATH in msys2 shell)
- #136923 (Lint `#[must_use]` attributes applied to methods in trait impls)
- #137155 (Organize `OsString`/`OsStr` shims)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Organize `OsString`/`OsStr` shims
Synchronize the `bytes.rs` and `wtf8.rs` shims for `OsString`/`OsStr` so they're easier to diff between each other. This is mostly ordering items the same between the two. I tried to minimize moves and went for the average locations between the files.
With them in the same order, it is clear that `FromInner<_>` is not implemented for `bytes::Buf` and `Clone::clone_from` is not implemented for `wtf8::Buf`, but they are for the other. Fix that.
I added #[inline] to all inherent methods of the `OsString`/`OsStr` shims, because it seemed that was already the rough pattern. `bytes.rs` has more inlining than `wtf8.rs`, so I added the corresponding ones to `wtf8.rs`. Then, the common missing ones have no discernible pattern to me. They're not divided by non-allocating/allocating. Perhaps the pattern is that UTF-8 validation isn't inlined? Since these types are merely the inner values in `OsStr`/`OsString`, I put inline on all methods and let those public types dictate inlining. I have not inspected codegen or run benchmarks.
Also, touch up some (private) documentation comments.
r? ``````@ChrisDenton``````
|
|
Add `MAX_LEN_UTF8` and `MAX_LEN_UTF16` Constants
This pull request adds the `MAX_LEN_UTF8` and `MAX_LEN_UTF16` constants as per #45795, gated behind the `char_max_len` feature.
The constants are currently applied in the `alloc`, `core` and `std` libraries.
|
|
Stabilize file_lock
Closes #130994
|
|
Add a bullet point to `std::fs::copy`
I needed to copy a file but I got the following error:
```
Os { code: 2, kind: NotFound, message: "No such file or directory" }
```
After read the documentation, I though the error was generated by the `from` parameter, forgetting the `to` part. Anyway, I got the error because the parent folder of `to` didn't exist.
Even if the documentation explicitly saying `but is not limited to just these cases`, I would like to add this case because I spent 3 hours around it.
This PR just wants to put a mention about it.
|
|
Improve instant docs
This should be enough to close #79881.
|
|
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
|
|
|
|
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
|
|
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
|
|
Rollup of 10 pull requests
Successful merges:
- #135711 (Do not ICE on default_field_value const with lifetimes)
- #136599 (librustdoc: more usages of `Joined::joined`)
- #136876 (Locking documentation updates)
- #137000 (Deeply normalize item bounds in new solver)
- #137126 (fix docs for inherent str constructors)
- #137161 (Pattern Migration 2024: fix incorrect messages/suggestions when errors arise in macro expansions)
- #137191 (Update mdbook and move error_index_generator)
- #137203 (Improve MIR modification)
- #137206 (Make E0599 a structured error)
- #137218 (misc `layout_of` cleanup)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
To make the error cases easier to spot on a quick glance.
|
|
Locking documentation updates
- Reword file lock documentation to clarify advisory vs mandatory. Remove the
word "advisory", and make it more explicit that the lock may be advisory or
mandatory depending on platform.
- Document that locking a file fails on Windows if the file is opened only for append
|
|
add last std diagnostic items for clippy
Part of https://github.com/rust-lang/rust-clippy/issues/5393.
Add diagnostic item attributes to the items in `std` and `core` where clippy currently uses hardcoded paths (https://github.com/rust-lang/rust-clippy/blob/master/clippy_utils/src/paths.rs).
|
|
Remove `std::os::wasi::fs::FileExt::tell`
Following #137165 (Use `tell` for `<File as Seek>::stream_position`), `tell` is now directly exposed via `stream_position`, making `<File as FileExt>::tell` redundant. Remove it.
`std::os::wasi::fs::FileExt::tell` is currently unstable and tracked in https://github.com/rust-lang/rust/issues/71213.
``@rustbot`` ping wasi
|
|
tests: Also gate `f16::erfc()` doctest with `reliable_f16_math` cfg
In #136324 the doctest for `f16::erf()` was gated with `reliable_f16_math`. Add the same gate on `f16::erfc()` to avoid:
rust_out.71e2e529d20ea47d-cgu.0:\
(.text._ZN8rust_out4main43_doctest_main_library_std_src_f16_rs_1321_017h485f3ffe6bf2a981E+0x38): \
undefined reference to `__gnu_h2f_ieee'
on MIPS (and maybe other architectures).
r? tgross35
|
|
|
|
(cherry picked from commit e4840ce59bdddb19394df008c5c26d9c493725f8)
|
|
|
|
|
|
|
|
Following #137165 (Use `tell` for `<File as Seek>::stream_position`),
`tell` is now directly exposed via `stream_position`, making
`<File as FileExt>::tell` redundant. Remove it.
|
|
#109797 is fixed
|
|
Use `tell` for `<File as Seek>::stream_position`
Some platforms have a more efficient way to get the current offset of the file than by seeking. For example, Wasi has `fd_tell` and SOLID has `SOLID_FS_Ftell`. Implement `<File as Seek>::stream_position()` in terms of those.
I do not use any APIs that were not already used in `std`. Although, the `libc` crate has [`ftell`](https://docs.rs/libc/latest/libc/fn.ftell.html), [`ftello`](https://docs.rs/libc/latest/libc/fn.ftello.html), and [`ftello64`](https://docs.rs/libc/latest/libc/fn.ftello64.html), I do not know platform coverage. It appears that Windows has no `tell`-like API.
I have checked that it builds on each relevant platform.
|
|
|
|
In 136324 the doctest for `f16::erf()` was gated with
`reliable_f16_math`. Add the same gate on `f16::erfc()` to
avoid:
rust_out.71e2e529d20ea47d-cgu.0:\
(.text._ZN8rust_out4main43_doctest_main_library_std_src_f16_rs_1321_017h485f3ffe6bf2a981E+0x38): \
undefined reference to `__gnu_h2f_ieee'
on MIPS (and maybe other architectures).
|
|
Use `const_error!` when possible
Replace usages of `io::Error::new(io::ErrorKind::Variant, "constant string")` with `io::const_error!(io::ErrorKind::Variant, "constant string")` to avoid allocations when possible. Additionally, fix `&&str` error messages in SGX and missing/misplaced trailing commas in `const_error!`.
|
|
* Order items as the average of the two adaptors. Enables easier diffs.
* Consistently apply #[inline].
* Implement FromInner<Vec<u8>> for bytes::Buf.
* Implement Clone::clone_from for wtf8::Buf.
|
|
|
|
|
|
Apply unsafe_op_in_unsafe_fn to the standard library
This applies unsafe_op_in_unsafe_fn to the standard library in preparation for updating to Rust 2024.
Closes https://github.com/rust-lang/rust/issues/127747 (I think?) cc ``@workingjubilee``
I have been testing a variety of targets, and I feel like they are all pretty much covered. I'll continue doing some testing async, but I don't expect to catch any more.
|
|
|
|
Rollup of 9 pull requests
Successful merges:
- #135687 (re-export `FromCoroutine` from `core::iter`)
- #135813 (CI: split i686-mingw job to three free runners)
- #136749 (Implement Extend<AsciiChar> for String)
- #136879 (Add safe new() to NotAllOnes)
- #136978 (Windows: Update generated bindings)
- #137028 (mir_build: Clarify some code for lowering `hir::PatExpr` to THIR)
- #137029 (Remove unnecessary check code in unused_delims)
- #137056 (made check_argument_compat public for use in miri)
- #137062 (Forward all default methods for I/O impls)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
r=workingjubilee
Forward all default methods for I/O impls
Forward all default methods for `&mut T` and `Box<T>` to the inner `io::Read`, `io::Write`, `io::Seek`, and `io::BufRead` types.
|
|
Windows: Update generated bindings
Update to windows-bindgen 0.59.
This update is aimed at reducing churn in the future, but means a bit more churn now:
- `bindings.txt` no longer needs us to write the namespace for each item. This is good because it means in the future we won't need to change them if the namespace changes. However, there are a few where we still need to disambiguate due to duplicate items (this is a bug in the upstream metadata).
- The output in `windows-sys.rs` is now sorted. It was mostly sorted before but not intentionally. This should mean future changes are less noisy.
The actual code changes are minimal here. A few types are now `bool` instead of `BOOLEAN`, which is more convenient.
|
|
Add safe new() to NotAllOnes
Replaces duplicated `unsafe` code with a single, easier to verify implementation.
|
|
|
|
Implement `f{16,32,64,128}::{erf,erfc}` (`#![feature(float_erf)]`)
Tracking issue: #136321
try-job: x86_64-gnu-aux
|
|
Prepare standard library for Rust 2024 migration
This includes a variety of commits preparing the standard library for migration to Rust 2024.
The actual migration is blocked on a few things, so I wanted to get this out of the way in a relatively digestable PR.
|
|
|
|
These functions were changed to be safe in
https://github.com/rust-lang/rust/pull/127763, but this particular UWP
version was missed. Otherwise this causes unnecessary unsafe block
warnings/errors.
|
|
Use `slice::fill` in `io::Repeat` implementation
Use the existing `fill` methods on slices instead of manually writing the fill loop.
|
|
Remove the common prelude module
This fixes the issues described in https://github.com/rust-lang/rust/issues/136102. Primarily, this resolves some issues with how the documentation for the prelude is generated:
- It avoids showing "unstable" for macros in the prelude that are actually stable.
- Avoids duplication of some pages due to the previous lack of `doc(no_inline)`.
- Makes the different edition preludes consistent, and sets a pattern that can be used by future editions.
We may need to rearrange these modules in the future if we decide to remove anything from the prelude again. If we do, I think we should look into a different solution that avoids the documentation problems.
Closes https://github.com/rust-lang/rust/issues/136102
|