Commit Graph

8375 Commits

Author SHA1 Message Date
Josh Stone
e851e3e16e Update cfg(bootstrap) 2025-07-01 10:55:49 -07:00
Josh Stone
9ce8930da6 Update version placeholders 2025-07-01 10:54:33 -07:00
Guillaume Gomez
827cd29a4c Rollup merge of #142760 - epage:lock, r=tgross35
docs(fs): Touch up grammar on lock api
2025-07-01 17:47:01 +02:00
Trevor Gross
978e11baa2 Upgrade the fortanix-sgx-abi dependency
0.6.1 removes the `compiler-builtins` dependency, part of RUST-142265.
The breaking change from 0.5 to 0.6 is for an update to the
`insecure_time` API [1].

I validated that `./x c library --target x86_64-fortanix-unknown-sgx`
completes successfully with this change.

Link: a34e9767f3 [1]
2025-07-01 03:33:10 -05:00
dianqk
a94f0a4af8 Rollup merge of #143090 - ChrisDenton:workaround1, r=tgross35
Workaround for memory unsafety in third party DLLs

Resolves rust-lang/rust#143078

Note that we can't make any guarantees if third parties intercept OS functions and don't implement them according to the documentation. However, I think it's practical to attempt mitigations when issues are encountered in the wild and the mitigation itself isn't too invasive.
2025-06-30 19:23:16 +08:00
Matthias Krüger
eef87fd974 Rollup merge of #142889 - nabijaczleweli:rusts, r=Mark-Simulacrum
Clarify doc comment on unix OpenOptions
2025-06-29 06:59:29 +02:00
Matthias Krüger
02cb521cbf Rollup merge of #143082 - fee1-dead-contrib:push-qvvppzukvkxt, r=Mark-Simulacrum
update internal `send_signal` comment

the vxwork did not have the old comment updated in rust-lang/rust#141990 so update here;

signaling -> sending signals to because the latter reads better to me.
2025-06-28 22:05:31 +02:00
Matthias Krüger
7394bd5fc2 Rollup merge of #123476 - devnexen:std_net_solaris_exclbind, r=Mark-Simulacrum
std::net: adding `unix_socket_exclbind` feature for solaris/illumos.

allows to have a tigher control over the binding exclusivness of the socket.

ACP: https://github.com/rust-lang/libs-team/issues/366
2025-06-28 22:05:27 +02:00
наб
45204ef4f4 "set by Rusts options". Remove misleading always-true if cfg!(unix). Drop #![feature(rustc_private)] 2025-06-28 17:57:57 +02:00
Chris Denton
953cf27c7a Workaround for mem safety in third party dlls 2025-06-28 09:59:42 +00:00
Matthias Krüger
9d15167921 Rollup merge of #140809 - bjorn3:panic_runtime_cleanup, r=petrochenkov
Reduce special casing for the panic runtime

See the individual commits for more info.
2025-06-27 22:13:01 +02:00
Kurt Heiritz (pseudo)
06fb36c92e Update poison.rs to fix the typo (sys->sync) 2025-06-27 16:26:53 +05:30
Deadbeef
7a79454de4 update internal send_signal comment 2025-06-27 18:24:42 +08:00
bors
e61dd437f3 Auto merge of #143074 - compiler-errors:rollup-cv64hdh, r=compiler-errors
Rollup of 18 pull requests

Successful merges:

 - rust-lang/rust#137843 (make RefCell unstably const)
 - rust-lang/rust#140942 (const-eval: allow constants to refer to mutable/external memory, but reject such constants as patterns)
 - rust-lang/rust#142549 (small iter.intersperse.fold() optimization)
 - rust-lang/rust#142637 (Remove some glob imports from the type system)
 - rust-lang/rust#142647 ([perf] Compute hard errors without diagnostics in impl_intersection_has_impossible_obligation)
 - rust-lang/rust#142700 (Remove incorrect comments in `Weak`)
 - rust-lang/rust#142927 (Add note to `find_const_ty_from_env`)
 - rust-lang/rust#142967 (Fix RwLock::try_write documentation for WouldBlock condition)
 - rust-lang/rust#142986 (Port `#[export_name]` to the new attribute parsing infrastructure)
 - rust-lang/rust#143001 (Rename run always )
 - rust-lang/rust#143010 (Update `browser-ui-test` version to `0.20.7`)
 - rust-lang/rust#143015 (Add `sym::macro_pin` diagnostic item for `core::pin::pin!()`)
 - rust-lang/rust#143033 (Expand const-stabilized API links in relnotes)
 - rust-lang/rust#143041 (Remove cache for citool)
 - rust-lang/rust#143056 (Move an ACE test out of the GCI directory)
 - rust-lang/rust#143059 (Fix 1.88 relnotes)
 - rust-lang/rust#143067 (Tracking issue number for `iter_macro`)
 - rust-lang/rust#143073 (Fix some fixmes that were waiting for let chains)

Failed merges:

 - rust-lang/rust#143020 (codegen_fn_attrs: make comment more precise)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-27 00:44:20 +00:00
Michael Goulet
c5ac143b22 Rollup merge of #142967 - krikera:fix-rwlock-try-write-docs, r=jhpratt
Fix RwLock::try_write documentation for WouldBlock condition

Fix RwLock::try_write documentation for WouldBlock condition

The documentation incorrectly stated that try_write only fails when
'already locked exclusively', but it actually fails when there are
either shared (read) or exclusive (write) locks.

Fixes rust-lang/rust#142852
2025-06-26 20:15:22 -04:00
krikera
7a70f642d3 Fix RwLock::try_write documentation for WouldBlock condition 2025-06-26 15:33:43 +05:30
Folkert de Vries
1dfc8406dc make tidy-alphabetical use a natural sort 2025-06-25 22:52:38 +02:00
Jubilee
d46903b2b6 Rollup merge of #142453 - ChrisDenton:fused, r=Amanieu
Windows: make `read_dir` stop iterating after the first error is encountered

This also essentially makes the `ReadDir` iterator fused. Which I think is pretty much what people expect anyway.

[`FindNextFileW`](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findnextfilew) doesn't document what happens if you call it after iteration ends or after an error so we're probably in implementation defined territory at that point.
2025-06-24 19:45:30 -07:00
bjorn3
6d3ff3915e Avoid exporting panic_unwind as stdlib cargo feature
There is already panic-unwind to enable it.
2025-06-24 19:44:35 +00:00
Guillaume Gomez
0377330be4 Rollup merge of #142704 - tgross35:remove-concat_idents, r=fee1-dead
Remove the deprecated unstable `concat_idents!` macro

In [rust-lang/rust#137653], the lang and libs-API teams did a joint FCP to deprecate
and eventually remove the long-unstable `concat_idents!` macro. The
deprecation is landing in 1.88, so do the removal here (target version
1.90).

This macro has been superseded by the more recent `${concat(...)}`
metavariable expression language feature, which avoids some of the
limitations of `concat_idents!`. The metavar expression is unstably
available under the [`macro_metavar_expr_concat`] feature.

History is mildly interesting here: `concat_idents!` goes back to 2011
when it was introduced with 513276e595 ("Add #concat_idents[] and
#ident_to_str[]"). The syntax looks a bit different but it still works
about the same:

    let asdf_fdsa = "<.<";
    assert(#concat_idents[asd,f_f,dsa] == "<.<");

    assert(#ident_to_str[use_mention_distinction]
           == "use_mention_distinction");

(That test existed from introduction until its removal here.)

Closes: https://github.com/rust-lang/rust/issues/29599

[rust-lang/rust#137653]: https://github.com/rust-lang/rust/pull/137653
[`macro_metavar_expr_concat`]: https://github.com/rust-lang/rust/issues/124225
2025-06-24 15:39:38 +02:00
Trevor Gross
0e4de4ceb0 Remove the deprecated concat_idents! macro
In [137653], the lang and libs-API teams did a joint FCP to deprecate
and eventually remove the long-unstable `concat_idents!` macro. The
deprecation is landing in 1.88, so do the removal here (target version
1.90).

This macro has been superseded by the more recent `${concat(...)}`
metavariable expression language feature, which avoids some of the
limitations of `concat_idents!`. The metavar expression is unstably
available under the [`macro_metavar_expr_concat`] feature.

History is mildly interesting here: `concat_idents!` goes back to 2011
when it was introduced with 513276e595 ("Add #concat_idents[] and
about the same:

    let asdf_fdsa = "<.<";
    assert(#concat_idents[asd,f_f,dsa] == "<.<");

    assert(#ident_to_str[use_mention_distinction]
           == "use_mention_distinction");

(That test existed from introduction until its removal here.)

Closes: https://www.github.com/rust-lang/rust/issues/29599

[137653]: https://www.github.com/rust-lang/rust/pull/137653
[`macro_metavar_expr_concat`]: https://www.github.com/rust-lang/rust/issues/124225
2025-06-24 11:07:16 +00:00
Guillaume Gomez
24cd817cfa Rollup merge of #140005 - mlowicki:patch-1, r=tgross35
Set MSG_NOSIGNAL for UnixStream

https://github.com/rust-lang/rust/issues/139956

Same logic as for 1f76d219c9/library/std/src/sys/net/connection/socket.rs (L399-L405).
2025-06-24 11:20:05 +02:00
Jubilee
fc3d7ee7b7 Rollup merge of #141324 - Ayush1325:uefi-rand-fallback, r=joboet
std: sys: random: uefi: Provide rdrand based fallback

Some UEFI systems based on American Megatrends Inc. v3.3 do not provide RNG support [1]. So fallback to rdrand in such cases.

[1]: https://github.com/rust-lang/rust/issues/138252#issuecomment-2891270323

Fixes https://github.com/rust-lang/rust/issues/138252

cc `@seijikun`
2025-06-23 12:48:19 -07:00
mejrs
29ce695cd4 Stop dbg! macro yapping about format modifiers 2025-06-22 10:58:27 +02:00
Samuel Tardieu
6a9f223f00 Add diagnostic items for Clippy 2025-06-20 17:53:09 +02:00
Trevor Gross
e381a14b7c Rollup merge of #141990 - Qelxiros:141975-unix_send_signal, r=ChrisDenton,tgross35
Implement send_signal for unix child processes

Tracking issue: rust-lang/rust#141975

There are two main differences between my implementation and the Public API section of the tracking issue. ~First, `send_signal` requires a mutable reference, like `Child::kill`.~ Second, `ChildExt` has `Sealed` as a supertrait, bringing it more in line with other extension traits like `CommandExt`.

try-job: `dist-various*`
try-job: `test-various*`
2025-06-20 02:50:38 -04:00
Ed Page
977752fb01 docs(fs): Touch up grammar on lock api 2025-06-19 20:39:54 -05:00
Marijn Schouten
ed81a111d1 wasm: rm static mut 2025-06-19 15:56:32 +00:00
bors
8de4c7234d Auto merge of #141864 - Berrysoft:cygwin-path, r=ChrisDenton
Handle win32 separator for cygwin paths

This PR handles a issue that cygwin actually supports Win32 path, so we need to handle the Win32 prefix and separaters.

r? `@mati865`

cc `@jeremyd2019`

~~Not sure if I should handle the prefix like the windows target... Cygwin *does* support win32 paths directly going through the APIs, but I think it's not the recommended way.~~

Here I just use `cygwin_conv_path` because it handles both cygwin and win32 paths correctly and convert them into absolute POSIX paths.

UPDATE: Windows path prefix is handled.
2025-06-19 13:38:37 +00:00
Trevor Gross
965d260094 Rollup merge of #142654 - workingjubilee:increase-timeout-factor-on-mpmc-test, r=joshtriplett
library: Increase timeout on mpmc test to reduce flakes

This recently spuriously failed in a rollup, so I think we can afford to increase the base timeout and the amount of time slept for to provide a much wider margin for the timeout to be reached.
2025-06-18 20:22:51 -04:00
Jeremy Smart
b3914945ae add ChildExt(::send_signal) 2025-06-18 00:38:55 -04:00
Jubilee Young
66e056a3a7 library: Increase timeout on mpmc test to reduce flakes
This recently spuriously failed in a rollup, so I think we can afford to
increase the base timeout and the amount of time slept for to provide
a much wider margin for the timeout to be reached.
2025-06-17 16:10:37 -07:00
Jacob Pratt
b5fcc90fd7 Rollup merge of #142517 - ChrisDenton:anon-pipe, r=Mark-Simulacrum
Windows: Use anonymous pipes in Command

When setting `Stdio::pipe` on `Command` we want to create an anonymous pipe that can be used asynchronously (at least on our end). Usually we'd use [`CreatePipe`](https://learn.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-createpipe) to open anonymous pipes but unfortunately it opens pipes for synchronous access. The alternative is to use [`CreateNamedPipeW`](https://learn.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-createnamedpipew) which does allow asynchronous access but that requires giving a file name to the pipe. So we currently have this awful hack where we attempt to emulate anonymous pipes using `CreateNamedPipeW` by attempting to create a unique name and looping until we find one that doesn't already exist.

The better option is to use the lower level [`NtCreateNamedPipeFile`](https://learn.microsoft.com/en-us/windows/win32/devnotes/nt-create-named-pipe-file) (which is used internally by both `CreatePipe` and `CreateNamedPipeW`). This function wasn't documented until a few years ago but now that it is it's ok for us to use it.

try-job: *msvc*
try-job: *mingw*
2025-06-17 23:19:34 +02:00
Jakub Beránek
6092c1a074 Rollup merge of #142236 - yotamofek:pr/std/pathbuf-extend-docs, r=tgross35
Add documentation for `PathBuf`'s `FromIterator` and `Extend` impls

I think it's not very obvious that `PathBuf`'s `Extend` and `FromIterator` impls work like `PathBuf::push`, so I think these should be documented.
I'm not very happy with the wording and examples, open to suggestions :)
2025-06-16 14:31:10 +02:00
Yotam Ofek
45bbb3dfbf Add documentation for PathBuf's FromIterator and Extend impls 2025-06-16 07:49:27 +00:00
Michał Łowicki
426ab14250 Set MSG_NOSIGNAL for UnixSteam
https://github.com/rust-lang/rust/issues/139956

fix
2025-06-16 09:15:17 +02:00
王宇逸
3cb0cba054 Handle win32 separator & prefixes for cygwin paths 2025-06-16 09:24:07 +08:00
Chris Denton
0e1db54b7e Windows: Use anonymous pipes in Command 2025-06-15 16:56:50 +00:00
Christopher Berner
38712030ca Stabilize "file_lock" feature 2025-06-15 06:44:46 -07:00
Matthias Krüger
8f90d05657 Rollup merge of #141493 - tamird:addreskind-bytestr, r=joshtriplett
Delegate `<SocketAddr as Debug>` to `ByteStr`

This allows UTF-8 characters to be printed without escapes, rather than
just ASCII.

r? ``@joshtriplett``
2025-06-14 11:27:10 +02:00
Jubilee
63631fbd75 Rollup merge of #142452 - ChrisDenton:intermittent, r=Noratrieb
Remove "intermittent" wording from `ReadDir`

`ReadDir` claims that `next` will return an error "if there’s some sort of intermittent IO error during iteration". I'm really not sure what this was intended to mean but the implementations will simply return all OS errors encountered during iteration to the user. What else can they do?

This is technically a change in the documented API but seeing as how it doesn't bear any relationship with the implementation I don't think it needs a libs-api fcp.
2025-06-13 20:59:20 -07:00
Chris Denton
595e88ae7d Windows: make read_dir stop iterating on error 2025-06-13 09:49:48 +00:00
Chris Denton
ae645fc0b8 Remove "intermittent" wording from ReadDir 2025-06-13 09:14:15 +00:00
Matthias Krüger
71490fff31 Rollup merge of #142308 - tgross35:upgrade-library-object, r=Mark-Simulacrum
Upgrade `object`, `addr2line`, and `unwinding` in the standard library

Object:

0.37.0 is a semver-breaking release but the only breakage is in `elf::R_RISCV_GNU_*` and `pe::IMAGE_WEAK_EXTERN_*` constants, as well as Mach-O dyld. This API is not used by `std`, so we should be fine to upgrade.

This new version also includes functionality for parsing Wasm object files that we may eventually like to make use of.

Changelog: https://github.com/gimli-rs/object/blob/master/CHANGELOG.md#0370

Addr2line:

0.25.0 is a breaking change only because it upgrades the `gimli` version. It also includes a change to the `compiler-builtins` dependency that helps with [1].

Changelog: https://github.com/gimli-rs/addr2line/blob/master/CHANGELOG.md#0250-20250611

[1]: https://github.com/rust-lang/rust/issues/142265
2025-06-13 05:19:18 +02:00
Tamir Duberstein
ded2afcb23 Delegate <SocketAddr as Debug> to ByteStr
This allows UTF-8 characters to be printed without escapes, rather than
just ASCII.
2025-06-12 19:08:48 -04:00
Trevor Gross
1f6abbb99f Upgrade the standard library addr2line version
0.25.0 is a breaking change only because it upgrades the `gimli`
version. It also includes a change to the `compiler-builtins` dependency
that helps with [1].

Changelog: https://github.com/gimli-rs/addr2line/blob/master/CHANGELOG.md#0250-20250611

[1]: https://github.com/rust-lang/rust/issues/142265
2025-06-11 17:06:53 +00:00
Trevor Gross
1ec80452b6 Upgrade the standard library object version
0.37.0 is a semver-breaking release but the only breakage is in
`elf::R_RISCV_GNU_*` and `pe::IMAGE_WEAK_EXTERN_*` constants, as well as
Mach-O dyld. This API is not used by `std`, so we should be fine to
upgrade.

This new version also includes functionality for parsing Wasm object
files that we may eventually like to make use of.

Also includes the minor bump from 0.37.0 to 0.37.1 to help [1].

Changelog: https://github.com/gimli-rs/object/blob/master/CHANGELOG.md#0370

[1]: https://github.com/rust-lang/rust/issues/142265
2025-06-11 17:01:08 +00:00
David Carlier
1bbabb7ff7 std::net: adding unix_socket_exclbind feature for solaris/illumos.
allows to have a tigher control over the binding exclusivness of the
socket.
2025-06-10 19:44:45 +01:00
León Orell Valerian Liehr
590f630ec6 Rollup merge of #142102 - kiseitai3:141714_stdin_read_to_string_docs, r=tgross35
docs: Small clarification on the usage of read_to_string and read_to_end trait methods

Small clarification on the usage of read_to_string and read_to_end trait methods. The goal is to make it clear that these trait methods will become locked up if attempting to read to the end of stdin (which is a bit non-sensical unless the other end closes the pipe).

Fixes: rust-lang/rust#141714
2025-06-10 16:54:49 +02:00
kiseitai3
7d7fedbab4 docs: Small clarification on the usage of read_to_string and read_to_end trait methods 2025-06-10 05:08:39 +00:00