Commit Graph

4699 Commits

Author SHA1 Message Date
bors
e0922fba67 Auto merge of #113033 - JohnTitor:stabilize-unix-chown, r=cuviper
Stabilize chown functions (`unix_chown`)

Closes #88989
FCP is complete here: https://github.com/rust-lang/rust/issues/88989#issuecomment-1561125635
2023-07-22 07:27:01 +00:00
bors
78f97c9b25 Auto merge of #113911 - matthiaskrgr:rollup-wk6cr7v, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #113380 (style-guide: clean up "must"/"should"/"may")
 - #113723 (Resurrect: rustc_llvm: Add a -Z `print-codegen-stats` option to expose LLVM statistics.)
 - #113780 (Support `--print KIND=PATH` command line syntax)
 - #113810 (Make {Rc,Arc}::allocator associated functions)
 - #113907 (Minor improvements to Windows TLS dtors)

Failed merges:

 - #113392 (style-guide: Some cleanups from the fmt-rfcs repo history)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-21 05:36:01 +00:00
bors
1a44b45987 Auto merge of #113106 - marcospb19:improve-path-with-extension-function, r=thomcc
std: remove an allocation in `Path::with_extension`

`Path::with_extension` used to reallocate (and copy) paths twice per call, now it does it once, by checking the size of the previous and new extensions it's possible to call `PathBuf::with_capacity` and pass the exact capacity required.

This also reduces the memory consumption of the path returned from `Path::with_extension` by using exact capacity instead of using amortized exponential growth.
2023-07-21 03:47:29 +00:00
Chris Denton
40e116489f
Minor improvements to Windows TLS dtors 2023-07-20 23:27:24 +01:00
bors
6b53175b5d Auto merge of #113861 - ibraheemdev:mpsc-tls-bug, r=Mark-Simulacrum
Avoid tls access while iterating through mpsc thread entries

Upstream fix: https://github.com/crossbeam-rs/crossbeam/pull/802. Possibly fixes https://github.com/rust-lang/rust/issues/113726.
2023-07-20 12:30:12 +00:00
Matthias Krüger
538dcdad31
Rollup merge of #113787 - sanchopanca:process-command-windows-docs, r=ChrisDenton
Update documentation for std::process::Command's new method

In the current documentation, it's not specified that when creating a Command, the .exe extension can be omitted for Windows executables. However, for other types of executable files like .bat or .cmd, the complete filename including the extension must be provided.

I encountered it by noticing that `Command::new("wt").spawn().unwrap()` succeeds on my machine while `Command::new("code").spawn().unwrap()` panics. Turns out VS Code's entrypoint is .cmd file.

`resolve_exe` method mentions this behaviour in [a comment](e7fda447e7/library/std/src/sys/windows/process.rs (L425)), but it makes sense to mention it at a more visible place.

I've added this clarification to the documentation, which should make it more accurate and helpful for Rust developers working on the Windows platform.
2023-07-20 07:08:42 +02:00
Ibraheem Ahmed
fb31a1ac21 avoid tls access while iterating through mpsc thread entries 2023-07-19 11:50:29 -04:00
Esteban Küber
8eb5843a59 On nightly, dump ICE backtraces to disk
Implement rust-lang/compiler-team#578.

When an ICE is encountered on nightly releases, the new rustc panic
handler will also write the contents of the backtrace to disk. If any
`delay_span_bug`s are encountered, their backtrace is also added to the
file. The platform and rustc version will also be collected.
2023-07-19 14:10:07 +00:00
chenx97
d3727148a0 support for mips32r6 as a target_arch value 2023-07-18 18:58:18 +08:00
chenx97
c6e03cd951 support for mips64r6 as a target_arch value 2023-07-18 18:58:18 +08:00
Aleksandr Kovalev
5dea766dc9 Update documentation for std::process::Command's new method
In the current documentation, it's not specified that when creating
a Command, the .exe extension can be omitted for Windows executables.
However, for other types of executable files like .bat or .cmd,
the complete filename including the extension must be provided.

I encountered it by noticing that `Command::new("wt").spawn().unwrap()`
succeeds on my machine while `Command::new("code").spawn().unwrap()`
panics. Turns out VS Code's entrypoint is .cmd file.

`resolve_exe` method mentions this behaviour in a comment[1], but it
makes sense to mention it at more visible place.

I've added this clarification to the documentation, which should
make it more accurate and helpful for Rust developers
working on the Windows platform.

[1] e7fda447e7/library/std/src/sys/windows/process.rs (L425)
2023-07-18 11:32:04 +02:00
João M. Bezerra
6ffca76e9b std: add tests for Path::with_extension 2023-07-14 13:19:45 -03:00
Matthias Krüger
8d1dd7e67b
Rollup merge of #113618 - tshepang:patch-1, r=jyn514
update ancient note
2023-07-14 01:03:08 +02:00
Matthias Krüger
efc3c71c16
Rollup merge of #112525 - hermitcore:devel, r=m-ou-se
Adjustments for RustyHermit

The interface between `libstd` and the OS changed and some changes are not correctly merged for RustHermit. For instance, the crate `hermit_abi` isn't defined as public, although it provided the socket interface for the application.

In addition, the support of thread::available_parallelism is realized. It returns the number of available processors.
2023-07-14 01:03:07 +02:00
Mark Rousskov
0d93d787ba Replace version placeholder to 1.72 2023-07-12 21:24:05 -04:00
Tshepang Mbambo
df3f45dbc5
avoid ambiguous word
See https://github.com/rust-lang/rust/pull/113618#pullrequestreview-1526295432
2023-07-12 20:10:52 +02:00
Stefan Lankes
8666adeb61 use latest version of hermit-abi
0.3.0 and 0.3.1 have an issue and will be yanked. Consequently, std
should switch to 0.3.2.
2023-07-12 13:15:09 +02:00
Stefan Lankes
e1777f9690 fix usage of Timespec om the target hermit 2023-07-12 13:14:00 +02:00
Stefan Lankes
50c7344eaf define hermit_abi as public depedenceny
It's exported publicly, so it should not be linted.
2023-07-12 13:14:00 +02:00
Stefan Lankes
5842a3fe08 add support of available_parallelism for target hermit
On RustyHermit, the function `get_processor_count` returns the
number of activated processors.
2023-07-12 13:14:00 +02:00
Tshepang Mbambo
5710fca279
update ancient note 2023-07-12 12:23:40 +02:00
bors
48a814deab Auto merge of #103754 - SUPERCILEX:filled-mut, r=m-ou-se
Add back BorrowedBuf::filled_mut

This is useful if you want to do some processing on the bytes while still using the BorrowedBuf.

The API was removed in https://github.com/rust-lang/rust/pull/97015 with no explanation. The RFC also has it as part of its API, so this just seems like a mistake: [RFC](https://rust-lang.github.io/rfcs/2930-read-buf.html#:~:text=inline%5D%0A%20%20%20%20pub%20fn-,filled_mut,-(%26mut%20self))

ACP: https://github.com/rust-lang/libs-team/issues/139
2023-07-11 19:07:11 +00:00
Chris Wailes
dfcd3226ba Correct the Android stat struct definitions
See https://cs.android.com/android/platform/superproject/+/master:bionic/libc/include/sys/stat.h
for reference.
2023-07-10 15:13:25 -07:00
bors
05b82e551e Auto merge of #94748 - tbu-:pr_file_arc, r=Amanieu
Add `Read`, `Write` and `Seek` impls for `Arc<File>` where appropriate

If `&T` implements these traits, `Arc<T>` has no reason not to do so
either. This is useful for operating system handles like `File` or
`TcpStream` which don't need a mutable reference to implement these
traits.

CC #53835.
CC #94744.
2023-07-10 13:26:42 +00:00
bors
743333f3dd Auto merge of #108796 - devsnek:personality-pal-exception, r=workingjubilee
move personality to sys

this moves `personality` to sys, removing another PAL exception
2023-07-10 05:19:37 +00:00
Gus Caplan
90e11a2a58 move personality to sys 2023-07-09 22:11:21 -07:00
bors
71f71a5397 Auto merge of #108485 - devsnek:float-pat-exception, r=workingjubilee
move pal cfgs in f32 and f64 to sys

I'd like to push forward on `sys` being a separate crate. To start with, most of these PAL exception cases are very simple little bits of code like this, so I thought I would try tidying them up.
2023-07-10 02:50:53 +00:00
Gus Caplan
45b516c844 move pal cfgs in f32 and f64 to sys 2023-07-09 17:32:26 -07:00
The 8472
6f8ba511fa additional io::copy specializations
- copying from `&[u8]` and `VecDeque<u8>`
- copying to `Vec<u8>`
2023-07-09 00:05:56 +02:00
Michael Goulet
75febc6ed6
Rollup merge of #112008 - intruder-kat:master, r=Nilstrieb
Fix incorrect documented default bufsize in bufreader/writer
2023-07-06 20:11:38 -07:00
bors
85bf07972a Auto merge of #113269 - jyn514:update-compiler-builtins, r=Amanieu
Update compiler builtins

cc https://github.com/rust-lang/compiler-builtins/pull/532#discussion_r1249354225

in particular this pulls in https://github.com/rust-lang/compiler-builtins/pull/532 and https://github.com/rust-lang/compiler-builtins/pull/535.

Fixes https://github.com/rust-lang/rust/issues/93166. Fixes https://github.com/rust-lang/git2-rs/issues/706. Fixes https://github.com/rust-lang/rust/issues/109064. Fixes https://github.com/rust-lang/wg-cargo-std-aware/issues/74.
2023-07-06 18:58:54 +00:00
fee1-dead
1830b80c2d
Rollup merge of #113334 - fmease:revert-lexing-c-str-lits, r=compiler-errors
Revert the lexing of `c"…"` string literals

Fixes \[after beta-backport\] #113235.
Further progress is tracked in #113333.

This PR *manually* reverts parts of #108801 (since a git-revert would've been too coarse-grained & messy)
and git-reverts #111647.

CC `@fee1-dead` (#108801) `@klensy` (#111647)
r? `@compiler-errors`

`@rustbot` label F-c_str_literals beta-nominated
2023-07-06 09:20:33 +08:00
jyn
fd7f53112a Update compiler-builtins to 0.1.95
This pulls in the new `outline-atomics` intrinsics.
2023-07-05 10:41:41 -05:00
León Orell Valerian Liehr
9dbe67fc8c
Revert "use c literals in library"
This reverts commit f212ba6d6d.
2023-07-05 13:11:26 +02:00
León Orell Valerian Liehr
5b25f9d8bd
Revert "fix ptr cast"
This reverts commit 2f459f7f14.
2023-07-05 13:11:26 +02:00
bors
dfe0683138 Auto merge of #112594 - ChrisDenton:process=-kill, r=Amanieu
Return `Ok` on kill if process has already exited

This will require an FCP from `@rust-lang/libs-api.`

Fixes #112423. See that issue for more details.
2023-07-05 11:04:17 +00:00
Chris Denton
9e5f61fcdd
Workaround for old android not having echo 2023-07-05 09:54:16 +01:00
Chris Denton
4309954187
Test Child::kill behaviour on exited process 2023-07-04 09:50:49 +01:00
Jubilee Young
079949da8e Update std to backtrace 0.3.68
Dedup addr2line, miniz_oxide, object in .lock
2023-07-02 17:02:45 -07:00
Nilstrieb
1e5d8fbcc9 downgrade compiler_builtins
The outline-atomics support in compiler_builtins messed up and wasn't limited to linux only.
https://github.com/rust-lang/compiler-builtins/pull/532/files#r1249354225
2023-07-02 21:02:31 +02:00
Matthias Krüger
c4ba0a6912
Rollup merge of #113202 - guilliamxavier:patch-1, r=workingjubilee
std docs: factorize literal in Barrier example

Motivated by https://www.reddit.com/r/rust/comments/rnh5hu/barrier_question_barrier_does_not_sync_many/ (but maybe not worth it?)
2023-07-02 10:27:20 +02:00
Chris Denton
e7fda447e7
Return Ok on kill if process has already exited 2023-07-01 01:38:39 +01:00
Guilliam Xavier
e34ff93c6b
std docs: factorize literal in Barrier example 2023-06-30 16:11:30 +02:00
Tshepang Mbambo
5b46aa1122
make HashMap::or_insert_with example more simple 2023-06-29 09:33:15 +02:00
João M. Bezerra
11f35d6016 std: remove an allocation in Path::with_extension
`Path::with_extension` used to reallocate (and copy) paths twice per
call, now it does it once, by checking the size of the previous and new
extensions it's possible to call `PathBuf::with_capacity` and pass the
exact capacity it takes.

Also reduce the memory consumption of the path returned from
`Path::with_extension` by using exact capacity instead of using
amortized exponential growth.
2023-06-27 18:45:47 -03:00
Yuki Okushi
f95be95737
Stabilize chown functions (unix_chown)
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-06-25 23:28:25 +09:00
bors
c51fbb3dd3 Auto merge of #113001 - ChrisDenton:win-arm32-shim, r=thomcc
Move windows-sys arm32 shim to c.rs

This moves the arm32 shim in to c.rs instead of appending to the generated file itself.

This makes it simpler to change these workarounds if/when needed. The downside is we need to exclude a couple of functions from being generated (see the comment). A metadata solution could help here but they'll be easy enough to add back if that happens.
2023-06-25 11:27:19 +00:00
Matthias Krüger
48247884c9
Rollup merge of #113009 - ChrisDenton:remove-path, r=workingjubilee
Remove unnecessary `path` attribute

Follow up to #111401. I missed this at the time but it should now be totally unnecessary since the other include was removed.

r? `@workingjubilee`
2023-06-25 02:04:21 +02:00
Matthias Krüger
2ed4368d2f
Rollup merge of #112956 - Amanieu:weak-intrinsics, r=Mark-Simulacrum
Expose `compiler-builtins-weak-intrinsics` feature for `-Zbuild-std`

This was added in rust-lang/compiler-builtins#526 to force all compiler-builtins intrinsics to use weak linkage.
2023-06-25 02:04:20 +02:00
Matthias Krüger
8630b1b3f4
Rollup merge of #112950 - tshepang:patch-4, r=Mark-Simulacrum
DirEntry::file_name: improve explanation
2023-06-25 02:04:20 +02:00