| Age | Commit message (Collapse) | Author | Lines |
|
std::thread: set_name change for solaris/illumos.
truncate down to 32 (31 + 1) for solaris/illumos.
|
|
truncate down to 32 (31 + 1) for solaris/illumos.
|
|
std::thread: adding get_name implementation for solaris/illumos.
THREAD_NAME_MAX is 32 (31 max + 1 for the null terminator).
|
|
Refactor stack overflow handling
Currently, every platform must implement a `Guard` that protects a thread from stack overflow. However, UNIX is the only platform that actually does so. Windows has a different mechanism for detecting stack overflow, while the other platforms don't detect it at all. Also, the UNIX stack overflow handling is split between `sys::pal::unix::stack_overflow`, which implements the signal handler, and `sys::pal::unix::thread`, which detects/installs guard pages.
This PR cleans this by getting rid of `Guard` and unifying UNIX stack overflow handling inside `stack_overflow` (commit 1). Therefore we can get rid of `sys_common::thread_info`, which stores `Guard` and the current `Thread` handle and move the `thread::current` TLS variable into `thread` (commit 2).
The second commit is not strictly speaking necessary. To keep the implementation clean, I've included it here, but if it causes too much noise, I can split it out without any trouble.
|
|
|
|
THREAD_NAME_MAX is 32 (31 max + 1 for the null terminator).
|
|
Rollup of 5 pull requests
Successful merges:
- #123180 (Rewrite `core-no-fp-fmt-parse` test in Rust)
- #123267 (std::thread: adding get_name haiku implementation.)
- #123268 (warn against implementing Freeze)
- #123271 (doc: describe panic conditions for SliceIndex implementations)
- #123295 (add myself to compiler review rotation)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
follow-up #123233
|
|
|
|
|
|
|
|
|
|
This is an alternative to #121920
|
|
Eliminate `UbChecks` for non-standard libraries
The purpose of this PR is to allow other passes to treat `UbChecks` as constants in MIR for optimization after #122629.
r? RalfJung
|
|
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #121843 (Implement `-L KIND=`@RUSTC_BUILTIN/...`)`
- #122860 (coverage: Re-enable `UnreachablePropagation` for coverage builds)
- #123021 (Make `TyCtxt::coroutine_layout` take coroutine's kind parameter)
- #123024 (CFI: Enable KCFI testing of run-pass tests)
- #123083 (lib: fix some unnecessary_cast clippy lint)
- #123116 (rustdoc: Swap fields and variant documentations)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
lib: fix some unnecessary_cast clippy lint
Fixes few instances of `unnecessary_cast` clippy lint
|
|
See also https://github.com/rust-lang/rust/issues/74465#issuecomment-1676522051
Signed-off-by: tison <wander4096@gmail.com>
|
|
Soft-destabilize `RustcEncodable` & `RustcDecodable`, remove from prelude in next edition
cc rust-lang/libs-team#272
Any use of `RustcEncodable` and `RustcDecodable` now triggers a deny-by-default lint. The derives have been removed from the 2024 prelude. I specifically chose **not** to document this in the module-level documentation, as the presence in existing preludes is not documented (which I presume is intentional).
This does not implement the proposed change for `rustfix`, which I will be looking into shortly.
With regard to the items in the preludes being stable, this should not be an issue because #15702 has been resolved.
r? libs-api
|
|
Update `RwLock` deadlock example to not use shadowing
Tweak variable names in the deadlock example to remove any potential confusion that the behavior is somehow shadowing-related.
|
|
`UnixStream`: override `read_buf`
Split from #122441
r? ``@workingjubilee``
|
|
std library thread.rs: fix NetBSD code for ILP32 CPUs.
|
|
Unix: Support more platforms with `preadv` and `pwritev`
- `aix`, `dragonfly` and `openbsd` with direct call
- `watchos` with weak linkage
cc #89517
|
|
Tweak variable names in the deadlock example to remove any potential
confusion that the behavior is somehow shadowing-related.
|
|
unix fs: Make hurd using explicit new rather than From
408c0ea2162b ("unix time module now return result") dropped the From impl for SystemTime, breaking the hurd build (and probably the horizon build)
Fixes #123032
|
|
408c0ea2162b ("unix time module now return result") dropped the From
impl for SystemTime, breaking the hurd and horizon builds.
Fixes #123032
|
|
|
|
|
|
|
|
|
|
warning: casting raw pointers to the same type and constness is unnecessary (`*mut V` -> `*mut V`)
--> library\alloc\src\collections\btree\map\entry.rs:357:31
|
357 | let val_ptr = root.borrow_mut().push(self.key, value) as *mut V;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `root.borrow_mut().push
(self.key, value)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> library\alloc\src\ffi\c_str.rs:411:56
|
411 | let slice = slice::from_raw_parts_mut(ptr, len as usize);
| ^^^^^^^^^^^^ help: try: `len`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
warning: casting raw pointers to the same type and constness is unnecessary (`*mut T` -> `*mut T`)
--> library\alloc\src\slice.rs:516:25
|
516 | (buf.as_mut_ptr() as *mut T).add(buf.len()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `buf.as_mut_ptr()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
warning: casting raw pointers to the same type and constness is unnecessary (`*mut T` -> `*mut T`)
--> library\alloc\src\slice.rs:537:21
|
537 | (buf.as_mut_ptr() as *mut T).add(buf.len()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `buf.as_mut_ptr()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
warning: casting raw pointers to the same type and constness is unnecessary (`*const ()` -> `*const ()`)
--> library\alloc\src\task.rs:151:13
|
151 | waker as *const (),
| ^^^^^^^^^^^^^^^^^^ help: try: `waker`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
warning: casting raw pointers to the same type and constness is unnecessary (`*const ()` -> `*const ()`)
--> library\alloc\src\task.rs:323:13
|
323 | waker as *const (),
| ^^^^^^^^^^^^^^^^^^ help: try: `waker`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> library\std\src\sys_common\net.rs:110:21
|
110 | assert!(len as usize >= mem::size_of::<c::sockaddr_in>());
| ^^^^^^^^^^^^ help: try: `len`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> library\std\src\sys_common\net.rs:116:21
|
116 | assert!(len as usize >= mem::size_of::<c::sockaddr_in6>());
| ^^^^^^^^^^^^ help: try: `len`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
|
std::thread: refine available_parallelism for solaris/illumos.
Rather than the system-wide available cpus fallback solution, we fetch the cpus bound to the current process.
|
|
panic-in-panic-hook: formatting a message that's just a string is risk-free
This slightly improves the output in the 'panic while processing panic' case if the panic message does not involve any formatting. Follow-up to https://github.com/rust-lang/rust/pull/122930.
r? ``@Amanieu``
|
|
Fix build failure on ARM/AArch64/PowerPC/RISC-V FreeBSD/NetBSD
Fixes https://github.com/rust-lang/rust/pull/121881#discussion_r1536764650
Checked targets: aarch64-unknown-freebsd, powerpc64-unknown-freebsd, armv7-unknown-freebsd, riscv64gc-unknown-freebsd, aarch64-unknown-netbsd.
r? ``@Amanieu``
cc ``@devnexen``
|
|
|
|
Rather than the system-wide available cpus fallback solution, we fetch
the cpus bound to the current process.
|
|
|
|
|
|
Expand sys/os for UEFI
- Implement current_exe() and getcwd()
|
|
|
|
add panic location to 'panicked while processing panic'
Fixes https://github.com/rust-lang/rust/issues/97181
r? `@Amanieu`
|
|
docs(sync): normalize dot in fn summaries
All other functions in e.g. [`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) have a dot at the end of their first doc line, except for the newly stabilized [`Mutex::clear_poison`](https://doc.rust-lang.org/std/sync/struct.Mutex.html#method.clear_poison) (and its friend [`RwLock::clear_poison`](https://doc.rust-lang.org/std/sync/struct.RwLock.html#method.clear_poison)).
This PR remedies that by adding a normalizing dot.
|
|
|
|
|
|
Replace visibility test with reachability test in dead code detection
Fixes https://github.com/rust-lang/rust/issues/119545
Also included is a fix for an error now flagged by the lint
|
|
|
|
|
|
|
|
|