rust/library
Matthias Krüger 10018d8e10
Rollup merge of #137165 - thaliaarchi:file-tell, r=ChrisDenton
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.
2025-02-17 17:06:10 +01:00
..
alloc Rollup merge of #137105 - zachs18:cow-derefpure-restrict, r=Nadrieril 2025-02-17 06:38:15 +01:00
backtrace@9d2c34e7e6 Update backtrace 2025-02-13 14:32:50 -08:00
core Rollup merge of #137101 - GrigorenkoPV:str-inherent-lint, r=Urgau 2025-02-17 06:37:38 +01:00
coretests Rollup merge of #136749 - mzeitlin11:extend-asciichar, r=scottmcm 2025-02-15 02:37:28 -05:00
panic_abort panic_abort: Apply unsafe_op_in_unsafe_fn 2025-02-14 07:36:17 -08:00
panic_unwind panic_unwind: Apply unsafe_op_in_unsafe_fn 2025-02-14 07:36:17 -08:00
portable-simd Merge commit '3383cfbd35' into sync-from-portable-simd-2025-01-18 2025-01-18 15:37:14 -05:00
proc_macro proc_macro: Apply unsafe_op_in_unsafe_fn 2025-02-14 07:36:17 -08:00
profiler_builtins compiler & tools dependencies: 2024-12-17 17:41:00 +00:00
rtstartup Mark extern blocks as unsafe 2025-02-09 17:11:13 +00:00
rustc-std-workspace-alloc Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
rustc-std-workspace-core update rustc-std-workspace crates 2024-11-04 07:45:15 +01:00
rustc-std-workspace-std
std Rollup merge of #137165 - thaliaarchi:file-tell, r=ChrisDenton 2025-02-17 17:06:10 +01:00
stdarch@684de0d6fe Bump stdarch 2024-12-24 19:00:57 +01:00
sysroot Make profiler_builtins an optional dependency of sysroot, not std 2024-10-17 22:08:36 +11:00
test Rollup merge of #136844 - thaliaarchi:const-io-error, r=ChrisDenton 2025-02-17 06:37:37 +01:00
unwind unwind: Apply unsafe_op_in_unsafe_fn 2025-02-14 07:36:17 -08:00
windows_targets Mark extern blocks as unsafe 2025-02-09 17:11:13 +00:00
Cargo.lock library: Update rand to 0.9.0 2025-02-13 12:20:55 -08:00
Cargo.toml Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00