| Age | Commit message (Collapse) | Author | Lines |
|
Fix incorrect doc of ScopedJoinHandle::is_finished
Fixes the explanation how to use `is_finished` to achieve a non-blocking join. The updated version matches the documentation of the non-scoped JoinHandle::is_finished.
|
|
|
|
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
|
|
Fixes the explanation how to use is_finished to achieve a non-blocking
join. The updated version matches the documentation of the non-scoped
JoinHandle::is_finished.
|
|
Make `Barrier::new()` const
I guess this was just missed in #97791?
`@rustbot` label T-libs-api -T-libs
|
|
|
|
Get rid of some `#![allow(static_mut_refs)]`
|
|
Rollup of 6 pull requests
Successful merges:
- #120742 (mark `min_exhaustive_patterns` as complete)
- #121470 (Don't ICE on anonymous struct in enum variant)
- #121492 (coverage: Rename `is_closure` to `is_hole`)
- #121495 (remove repetitive words)
- #121498 (Make QNX/NTO specific "timespec capping" public to crate::sys)
- #121510 (lint-overflowing-ops: unify cases and remove redundancy)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
Use generic `NonZero` everywhere in `library`.
Tracking issue: https://github.com/rust-lang/rust/issues/120257
Use generic `NonZero` everywhere (except stable examples).
r? `@dtolnay`
|
|
It is used in:
- `library/std/src/sys/locks/condvar/pthread.rs`
- `library/std/src/sys/pal/unix/thread_parking/pthread.rs`
|
|
|
|
Help with common API confusion, like asking for `push` when the data structure really has `append`.
```
error[E0599]: no method named `size` found for struct `Vec<{integer}>` in the current scope
--> $DIR/rustc_confusables_std_cases.rs:17:7
|
LL | x.size();
| ^^^^
|
help: you might have meant to use `len`
|
LL | x.len();
| ~~~
help: there is a method with a similar name
|
LL | x.resize();
| ~~~~~~
```
#59450
|
|
|
|
|
|
|
|
Improve UEFI stdio
Fixed some things suggested in last PR: #116207
cc `@dvdhrm`
cc `@nicholasbishop`
|
|
|
|
allows for socket to process only when there is data to process,
the option sets a number of seconds until the data is ready.
|
|
also introduce ptr::dangling matching NonNull::dangling
|
|
|
|
|
|
|
|
Add manual Sync impl for ReentrantLockGuard
Fixes: #125526
Tracking Issue: #121440
this impl is even shown in the summary in the tracking issue, but apparently was forgotten in the actual implementation
|
|
use posix_memalign on almost all Unix targets
Seems nice to be able to use a single common codepath for all of them. :) The `libc` crate says this symbol exists for all Unix targets. I did locally do check-builds to ensure this still builds, but I can't really test more than that.
- For redox, I found indications posix_memalign really exists [here](https://gitlab.redox-os.org/redox-os/relibc/-/merge_requests/271)
- For esp-idf, I found indications [here](https://github.com/playable-tech/esp-idf/commit/c5b297a86f3d65081bc690e81ab53db47b18d31c)
- ~~For horizon and vita (these seem to be gaming console OSes? "Horizon OS" also has some hits for a Facebook product but that seems unrelated), they seem to be based on "newlib", where posix_memalign [seems to exist](https://sourceware.org/git/?p=newlib-cygwin.git;a=commitdiff;h=3ba2c39fb2a12cd7332ef16b1b3e3df994f7c6f5).~~ Turns out no, this 20-year-old standard POSIX function is unfortunately [not supported](https://github.com/rust-lang/rust/pull/125271#issuecomment-2119221419) here.
|
|
Fixes: #125526
|
|
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
|
|
|
|
Currently all architecture-specific memchr code is only used in
`std::io`. Most of the actual `memchr` capacity exposed to the user
through the slice API is instead implemented in core::slice::memchr.
Hence this commit deletes memchr from std::sys[_common] and replace
calls to it by calls to core::slice::memchr functions. This deletes
(r)memchr from the list of symbols linked to libc.
|
|
Remove an old hack for rustdoc
Since #78696 has been resolved
|
|
|
|
Move locks to `sys`
Part of #117276.
r? `@ChrisDenton`
|
|
Add `Future` and `IntoFuture` to the 2024 prelude
Implements rust-lang/rfcs#3509.
|
|
Specialize some methods of `io::Chain`
This PR specializes the implementation of some methods of `io::Chain`, which could bring performance improvements when using it.
|
|
Reduce monomorphisation bloat in small_c_string
This is a code path usually next to an FFI call, so taking the `dyn` slowdown for the 1159 llvm-line (fat lto, codegen-units 1, release build) drop in my testing program [t2fanrd](https://github.com/GnomedDev/t2fanrd) is worth it imo.
|
|
Implements RFC 3509.
|
|
|
|
|
|
|
|
Add uncontroversial syscall doc aliases to std docs
This PR contains the parts of #113891 that don’t break the doc alias policy.
r? `@Mark-Simulacrum`
|
|
Move `OsStr::slice_encoded_bytes` validation to platform modules
This delegates OS string slicing (`OsStr::slice_encoded_bytes`) validation to the underlying platform implementation. For now that results in increased performance and better error messages on Windows without any changes to semantics. In the future we may want to provide different semantics for different platforms.
The existing implementation is still used on Unix and most other platforms and is now optimized a little better.
Tracking issue: https://github.com/rust-lang/rust/issues/118485
cc `@epage,` `@BurntSushi`
|
|
|
|
Tracking import use types for more accurate redundant import checking
fixes #117448
By tracking import use types to check whether it is scope uses or the other situations like module-relative uses, we can do more accurate redundant import checking.
For example unnecessary imports in std::prelude that can be eliminated:
```rust
use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly
use std::option::Option::None; //~ WARNING the item `None` is imported redundantly
```
|
|
situations like module-relative uses, we can do more accurate redundant import checking.
fixes #117448
For example unnecessary imports in std::prelude that can be eliminated:
```rust
use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly
use std::option::Option::None; //~ WARNING the item `None` is imported redundantly
```
|
|
Rename `static_mut_ref` lint to `static_mut_refs`.
|
|
Use a hardcoded constant instead of calling OpenProcessToken.
Now that Win 7 support is dropped, we can resurrect #90144.
GetCurrentProcessToken is defined in processthreadsapi.h as:
FORCEINLINE
HANDLE
GetCurrentProcessToken (
VOID
)
{
return (HANDLE)(LONG_PTR) -4;
}
Since it's very unlikely that this constant will ever change, let's just use it instead of making calls to get the same information.
|
|
Make `io::BorrowedCursor::advance` safe
This also keeps the old `advance` method under `advance_unchecked` name.
This makes pattern like `std::io::default_read_buf` safe to write.
|
|
|
|
Now that Win 7 support is dropped, we can resurrect #90144.
GetCurrentProcessToken is defined in processthreadsapi.h as:
FORCEINLINE
HANDLE
GetCurrentProcessToken (
VOID
)
{
return (HANDLE)(LONG_PTR) -4;
}
Since it's very unlikely that this constant will ever change, let's just use it instead of making calls to get the same information.
|