| Age | Commit message (Collapse) | Author | Lines |
|
This documents the very surprising behaviour that `set_readonly(false)` will make a file *world writable* on Unix. I would go so far as to say that this function should be deprecated on Unix, or maybe even entirely. But documenting the bad behaviour is a good first step.
|
|
|
|
|
|
array docs - advertise how to get array from slice
On my first Rust project, I spent more time than I care to admit figuring out how to efficiently get an array from a slice. Update the array documentation to explain this a bit more clearly.
(As a side note, it's a bit unfortunate that get-array-from-slice is only available via trait since that means it can't be used from const functions yet.)
|
|
On later stages, the feature is already stable.
Result of running:
rg -l "feature.let_else" compiler/ src/librustdoc/ library/ | xargs sed -s -i "s#\\[feature.let_else#\\[cfg_attr\\(bootstrap, feature\\(let_else\\)#"
|
|
Adding "backtrace off" option for fuchsia targets
Used for improving compiler test suite results on Fuchsia targets
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Remove manual <[u8]>::escape_ascii
`@rustbot` label: +C-cleanup
|
|
Check if TCS is a null pointer on SGX
The `EENTER` instruction only checks if the TCS is aligned, not if it zero. Saying the address returned is a `NonNull<u8>` (for which `Tcs` is a type alias) is unsound. As well-behaved runners will not put the TCS at address zero, so the definition of `Tcs` is correct. However, `std` should check the address before casting it to a `NonNull`.
ping `@jethrogb` `@raoulstrackx`
`@rustbot` label I-unsound
|
|
|
|
|
|
Optimize thread parking on NetBSD
As the futex syscall is not present in the latest stable release, NetBSD cannot use the efficient thread parker and locks Linux uses. Currently, it therefore relies on a pthread-based parker, consisting of a mutex and semaphore which protect a state variable. NetBSD however has more efficient syscalls available: [`_lwp_park`](https://man.netbsd.org/_lwp_park.2) and [`_lwp_unpark`](https://man.netbsd.org/_lwp_unpark.2). These already provide the exact semantics of `thread::park` and `Thread::unpark`, but work with thread ids. In `std`, this ID is here stored in an atomic state variable, which is also used to optimize cases were the parking token is already available at the time `thread::park` is called.
r? `@m-ou-se`
|
|
On my first Rust project, I spent more time than I care to admit
figuring out how to efficiently get an array from a slice. Update the
array documentation to explain this a bit more clearly.
(As a side note, it's a bit unfortunate that get-array-from-slice is
only available via trait since that means it can't be used from const
functions yet.)
|
|
Explicitly link kernel32.lib from alloc
|
|
|
|
doc: fix minor typo
|
|
This improves the documentation to say *why* it was deprecated. The reason was because it reads `HOME` on Windows which is meaningless there. Note that the PR that deprecated it stated that returning an empty string if `HOME` is set to an empty string was a problem, however I can find no evidence that this is the case. `cd` handles it fine whereas if `HOME` is unset it gives an explicit `HOME not set` error.
* Original deprecation reason: https://internals.rust-lang.org/t/deprecate-or-break-fix-std-env-home-dir/7315
* Original deprecation PR: https://github.com/rust-lang/rust/pull/51656
See #71684
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- #101366 (Restore old behaviour on broken UNC paths)
- #101492 (Suggest adding array lengths to references to arrays if possible)
- #101529 (Fix the example code and doctest for Formatter::sign_plus)
- #101573 (update `ParamKindOrd`)
- #101612 (Fix code generation of `Rvalue::Repeat` with 128 bit values)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Restore old behaviour on broken UNC paths
This fixes #101358 by restoring the behaviour from previous stable Rust versions. I'm not convinced this is ultimately right but I think it's less wrong and maybe this should be backported to beta?
r? libs
|
|
|
|
|
|
Fix hermit warnings
This fixes two `unused_imprt` and one `dead_code` warning for hermit.
|
|
Hermit: Add File::set_time stub
This is not supported on hermit yet. This change is required for compiling std.
|
|
|
|
Rollup of 14 pull requests
Successful merges:
- #101343 (Add -api-level to pm command)
- #101416 (stdio: Document no support for writing to non-blocking stdio/stderr)
- #101435 (Remove unnecessary `EMIT_MIR_FOR_EACH_BITWIDTH`)
- #101493 (Pass ImplTraitContext as &mut to avoid the need of ImplTraitContext::reborrow)
- #101502 (Do not suggest a semicolon for a macro without `!`)
- #101503 (Add debug calls)
- #101506 (rustdoc: remove unused CSS `#main-content > .since`)
- #101507 (rustdoc: remove unused CSS `#main-content > table td`)
- #101521 (Rustdoc-Json: More accurate struct type.)
- #101525 (Fix typo in pass_manager.rs)
- #101534 (rustdoc: remove unused mobile CSS `.rustdoc { flex-direction }`)
- #101535 (Fix error printing mistake in tidy)
- #101536 (Add documentation for Attr::is_doc_comment)
- #101538 (rustdoc: remove unused CSS `.content .methods > div`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Open a BCrypt algorithm handle
Fixes #101474, supplants #101456.
Replaces use of a pseduo handle with manually opening a algorithm handle.
Most interesting thing here is the atomics.
r? `@thomcc`
|
|
Printing to stdio/stderr that have been opened with non-blocking
(O_NONBLOCK in linux) can result in an error, which is not handled
by std::io module causing a panic.
Signed-off-by: Usama Arif <usama.arif@bytedance.com>
|
|
|
|
|
|
|
|
Don't duplicate file descriptors into stdio fds
Ensures that file descriptors are never duplicated into the stdio fds even if a stdio fd has been closed.
|
|
Fix cleanup for uninitialized stdout
Fixes #101375 by disabling buffering even if the buffer was not initialized yet.
|
|
more clippy::perf fixes
|
|
|
|
|
|
Make `ReentrantMutex` movable and `const`
As `MovableMutex` is now `const`, it can be used to simplify the implementation and interface of the internal reentrant mutex type. Consequently, the standard error stream does not need to be wrapped in `OnceLock` and `OnceLock::get_or_init_pin()` can be removed.
|
|
|
|
|
|
This is not supported on hermit yet. This change is required for compiling std.
|
|
Forbid mixing `System` with direct sytem allocator calls
e.g. [on windows](https://github.com/rust-lang/rust/blob/dec689432fac6720b2f18101ac28a21add98b1b8/library/std/src/sys/windows/alloc.rs#L129-L178), trying to mix `System::alloc` and `HeapFree` will not work because of the extra work done to serve higher alignments.
|
|
`library/std/src/sys/sgx/abi/usercalls/alloc.rs` nicer
- Use `.addr()` instead of `as`-cast
- Use `add` instead of `offset` and remove some `as isize` casts by doing that
- Remove some casts
|
|
|