rust/library/std/src
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
..
backtrace remove redundant imports 2023-12-10 10:56:22 +08:00
collections Clean up 'HashMap' and 'HashSet' docs; 2025-02-07 13:40:23 +01:00
ffi fix OsString::from_encoded_bytes_unchecked description 2025-01-21 14:36:18 +01:00
fs Auto merge of #136754 - Urgau:rollup-qlkhjqr, r=Urgau 2025-02-09 12:54:26 +00:00
hash remove const_hash feature leftovers 2024-11-02 11:27:14 +01:00
io Rollup merge of #136844 - thaliaarchi:const-io-error, r=ChrisDenton 2025-02-17 06:37:37 +01:00
net std: replace the FromInner implementation for addresses with private conversion functions 2025-02-12 14:13:35 +01:00
os Add safe new to NotAllOnes 2025-02-14 12:00:13 +00:00
prelude Remove the common prelude module 2025-02-11 13:04:27 -08:00
process std: Apply deprecated_safe_2024 2025-02-13 13:10:28 -08:00
sync Fix pattern matching mode changes and unsafe_op_in_unsafe_fn 2025-02-09 17:11:13 +00:00
sys Rollup merge of #137165 - thaliaarchi:file-tell, r=ChrisDenton 2025-02-17 17:06:10 +01:00
sys_common Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum 2025-02-09 15:44:16 +00:00
thread Move std::thread_local unit tests to integration tests 2025-01-26 10:28:05 +00:00
alloc.rs std: Apply unsafe_op_in_unsafe_fn 2025-02-14 07:36:17 -08:00
ascii.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
backtrace.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
bstr.rs Implement ByteStr and ByteString types 2025-01-11 06:35:21 +02:00
env.rs std: Apply deprecated_safe_2024 2025-02-13 13:10:28 -08:00
error.rs Move std::error unit tests to integration tests 2025-01-26 10:28:04 +00:00
f16.rs Auto merge of #136324 - GrigorenkoPV:erf, r=tgross35 2025-02-15 04:52:50 +00:00
f32.rs Implement f{16,32,64,128}::{erf,erfc} 2025-02-14 01:23:16 +03:00
f64.rs Implement f{16,32,64,128}::{erf,erfc} 2025-02-14 01:23:16 +03:00
f128.rs Auto merge of #136324 - GrigorenkoPV:erf, r=tgross35 2025-02-15 04:52:50 +00:00
fs.rs Use tell for <File as Seek>::stream_position 2025-02-17 05:25:14 -08:00
keyword_docs.rs std: Apply missing_unsafe_on_extern 2025-02-13 13:10:27 -08:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs Rollup merge of #136967 - DaniPopes:io-repeat-fill, r=joboet 2025-02-14 16:23:32 +01:00
macros.rs Move std float unit tests to integration tests 2025-01-26 10:28:04 +00:00
num.rs Move std::num unit tests to integration tests 2025-01-26 10:28:04 +00:00
panic.rs std: Apply dependency_on_unit_never_type_fallback 2025-02-13 13:10:27 -08:00
panicking.rs Mark extern blocks as unsafe 2025-02-09 17:11:13 +00:00
pat.rs Add pattern types to parser 2024-04-08 11:57:17 +00:00
path.rs Fix &&str and trailing commas in io::const_error! 2025-02-10 16:34:13 -08:00
process.rs Fix sentence in process::abort 2025-02-01 13:32:01 +01:00
random.rs AIX use /dev/urandom for impl 2024-10-22 20:18:11 -04:00
rt.rs Rollup merge of #135446 - klensy:panic_immediate_abort_ext, r=Mark-Simulacrum 2025-01-20 12:38:32 +08:00
test_helpers.rs std: get rid of sys_common::io 2025-02-07 16:54:07 +01:00
time.rs Move std::time unit tests to integration tests 2025-01-26 10:28:04 +00:00