Commit Graph

16477 Commits

Author SHA1 Message Date
Trevor Gross
fd36e8b0ec Update compiler_builtins to 0.1.130
This includes the following which add `__divtf3` and `__powtf2`, and do
some feature cleanup:

- https://github.com/rust-lang/compiler-builtins/pull/622
- https://github.com/rust-lang/compiler-builtins/pull/692
- https://github.com/rust-lang/compiler-builtins/pull/614
- https://github.com/rust-lang/compiler-builtins/pull/694

The `cc` bump [1] was previously included but was reverted due to
problems updating.

[1]: https://github.com/rust-lang/compiler-builtins/pull/690
2024-09-28 11:25:47 -04:00
bors
612796c420 Auto merge of #130964 - matthiaskrgr:rollup-suriuub, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #125404 (Fix `read_buf` uses in `std`)
 - #130866 (Allow instantiating object trait binder when upcasting)
 - #130922 (Reference UNSPECIFIED instead of INADDR_ANY in join_multicast_v4)
 - #130924 (Make clashing_extern_declarations considering generic args for ADT field)
 - #130939 (rustdoc: update `ProcMacro` docs section on helper attributes)
 - #130940 (Revert space-saving operations)
 - #130944 (Allow instantiating trait object binder in ptr-to-ptr casts)
 - #130953 (Rename a few tests to make tidy happier)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-28 10:46:56 +00:00
bors
150247c338 Auto merge of #130897 - workingjubilee:dump-hexes-with-class, r=thomcc
library: Compute `RUST_EXCEPTION_CLASS` from native-endian bytes

This makes it appear correctly in hexdumps on both LE and BE platforms.
2024-09-28 07:47:26 +00:00
Matthias Krüger
9c4b81c238
Rollup merge of #130922 - tyilo:udp-unspecified, r=ibraheemdev
Reference UNSPECIFIED instead of INADDR_ANY in join_multicast_v4
2024-09-28 09:35:09 +02:00
Matthias Krüger
6e9db86787
Rollup merge of #125404 - a1phyr:fix-read_buf-uses, r=workingjubilee
Fix `read_buf` uses in `std`

Following lib-team decision here: https://github.com/rust-lang/rust/issues/78485#issuecomment-2122992314

Guard against the pathological behavior of both returning an error and performing a read.
2024-09-28 09:35:08 +02:00
bors
83e4e18896 Auto merge of #130946 - matthiaskrgr:rollup-ia4mf0y, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #130718 (Cleanup some known-bug issues)
 - #130730 (Reorganize Test Headers)
 - #130826 (Compiler: Rename "object safe" to "dyn compatible")
 - #130915 (fix typo in triagebot.toml)
 - #130926 (Update cc to 1.1.22 in library/)
 - #130932 (etc: Add sample rust-analyzer configs for eglot & helix)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-27 21:23:29 +00:00
Matthias Krüger
22c1009e7f
Rollup merge of #130926 - ChrisDenton:cc-1-1-22, r=tgross35
Update cc to 1.1.22 in library/

r? `@ghost`

try-job: x86_64-msvc
2024-09-27 21:35:09 +02:00
Matthias Krüger
e76eb96a00
Rollup merge of #129087 - slanterns:option_get_or_insert_default, r=dtolnay
Stabilize `option_get_or_insert_default`

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

`@rustbot` label: +T-libs-api

r? libs-api
2024-09-27 19:07:58 +02:00
Chris Denton
892d192b15
Update Cargo.lock 2024-09-27 09:41:56 +00:00
Asger Hautop Drewsen
fa3215daad Reference UNSPECIFIED instead of INADDR_ANY in join_multicast_v4 2024-09-27 10:05:52 +02:00
Jubilee
081b9469d8
Rollup merge of #130892 - tgross35:library-cargo-update, r=Noratrieb
Partially update `library/Cargo.lock`

Run `cargo update` in library but exclude updates to `cc` and to `compiler_builtins`. Exclusions were done because `cc` seems to have some issues updating [1], and `compiler_builtins` needs to be updated on its own.

Partially supersedes https://github.com/rust-lang/rust/pull/129538.

[1]: https://github.com/rust-lang/rust/pull/130720

try-job: x86_64-msvc
2024-09-26 22:20:56 -07:00
Jubilee
1e882537d4
Rollup merge of #130875 - folkertdev:naked-asm-bootstrap, r=tgross35
update `compiler-builtins` to 0.1.126

this requires the addition of a bootstrap variant of the new `naked_asm!` macro

r? `@tgross35`

extracted from https://github.com/rust-lang/rust/pull/128651
2024-09-26 22:20:55 -07:00
Jubilee
9734723259
Rollup merge of #130846 - ChrisDenton:revert-break, r=Noratrieb
Revert Break into the debugger on panic (129019)

This was talked about a bit at a recent libs meeting. While I think experimenting with this is worthwhile, I am nervous about this new behaviour reaching stable. We've already reverted on one tier 1 platform (Linux, https://github.com/rust-lang/rust/pull/130810) which means we have differing semantics on different tier 1 platforms. Also the fact it triggers even when `catch_unwind` is used to catch the panic means it can be very noisy in some projects.

At the very least I think it could use some more discussion before being instantly stable. I think this could maybe be re-landed with an environment variable to control/override the behaviour. But that part would likely need a libs-api decision.

cc ````@workingjubilee```` ````@kromych````
2024-09-26 22:20:54 -07:00
Jubilee
98f567b35a
Rollup merge of #130313 - c410-f3r:unlock-rfc-2011, r=thomcc
[`cfg_match`] Generalize inputs

cc #115585

Changes the input type from `item` to `tt`, which makes the macro have the same functionality of `cfg_if`.

Also adds a test to ensure that `stmt_expr_attributes` is not triggered.
2024-09-26 22:20:53 -07:00
Guillaume Gomez
3d4d45f87b
Rollup merge of #130880 - RalfJung:const-hack, r=scottmcm
add missing FIXME(const-hack)

r? ```@scottmcm```
2024-09-27 00:43:35 +02:00
Guillaume Gomez
329f9fcb05
Rollup merge of #130861 - cuviper:sun-path-offset, r=ibraheemdev
Use `mem::offset_of!` for `sockaddr_un.sun_path`

We don't need manual pointer math here anymore!

try-job: dist-i686-msvc
2024-09-27 00:43:33 +02:00
Guillaume Gomez
e65054633c
Rollup merge of #130845 - RalfJung:utf8chunk, r=tgross35
Utf8Chunks: add link to Utf8Chunk

It is currently surprisingly non-trivial to go from the `utf8_chunks` method to the docs of the `valid`/`invalid` methods used in the example. This should help.
2024-09-27 00:43:32 +02:00
Guillaume Gomez
8a827c77e3
Rollup merge of #130279 - theemathas:manually-drop-docs, r=thomcc,traviscross
Document subtleties of `ManuallyDrop`

After seeing #130140 and #130141, I figured that `ManuallyDrop` needs documentation explaining its subtleties, hence this PR.

See also https://github.com/rust-lang/unsafe-code-guidelines/issues/245
2024-09-27 00:43:30 +02:00
Jubilee Young
f21f4cd60e library: Compute RUST_EXCEPTION_CLASS from native-endian bytes
This makes it appear correctly in hexdumps on both LE and BE platforms.
2024-09-26 11:34:17 -07:00
Trevor Gross
fa64fb1de6 Partially update library/Cargo.lock
Run `cargo update` in library but exclude updates to `cc` and to
`compiler_builtins`. Exclusions were done because `cc` seems to have
some issues updating [1], and `compiler_builtins` needs to be updated on
its own.

[1]: https://github.com/rust-lang/rust/pull/130720
2024-09-26 13:21:48 -04:00
Josh Stone
9431d1ab4e Add sun_path to the fake doc sockaddr_un 2024-09-26 09:33:30 -07:00
Ralf Jung
ef87a7f663 add missing FIXME(const-hack) 2024-09-26 15:42:37 +02:00
Folkert de Vries
42542d8cda update compiler_builtins to 0.1.126 2024-09-26 09:54:28 +02:00
Folkert de Vries
20c0067528 add a bootstrap variant of naked_asm 2024-09-26 09:54:00 +02:00
Josh Stone
f4d9d1a0ea Use &raw in the standard library
Since the stabilization in #127679 has reached stage0, 1.82-beta, we can
start using `&raw` freely, and even the soft-deprecated `ptr::addr_of!`
and `ptr::addr_of_mut!` can stop allowing the unstable feature.

I intentionally did not change any documentation or tests, but the rest
of those macro uses are all now using `&raw const` or `&raw mut` in the
standard library.
2024-09-25 17:03:20 -07:00
Josh Stone
a51b0a2adf Use mem::offset_of! for sockaddr_un.sun_path 2024-09-25 16:40:50 -07:00
Matthias Krüger
e805182fcc
Rollup merge of #130842 - Noratrieb:tracking-issue-inprogress, r=jieyouxu
Add tracking issue for io_error_inprogress

I forgot to mention this in #130789
2024-09-25 20:11:01 +02:00
Matthias Krüger
3a3352386c
Rollup merge of #130832 - RalfJung:sort-cfg-mess, r=workingjubilee
fix some cfg logic around optimize_for_size and 16-bit targets

Fixes https://github.com/rust-lang/rust/issues/130818.
Fixes https://github.com/rust-lang/rust/issues/129910.

There are still some warnings when building on a 16bit target:
```
warning: struct `AlignedStorage` is never constructed
   --> /home/r/src/rust/rustc.2/library/core/src/slice/sort/stable/mod.rs:135:8
    |
135 | struct AlignedStorage<T, const N: usize> {
    |        ^^^^^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

warning: associated items `new` and `as_uninit_slice_mut` are never used
   --> /home/r/src/rust/rustc.2/library/core/src/slice/sort/stable/mod.rs:141:8
    |
140 | impl<T, const N: usize> AlignedStorage<T, N> {
    | -------------------------------------------- associated items in this implementation
141 |     fn new() -> Self {
    |        ^^^
...
145 |     fn as_uninit_slice_mut(&mut self) -> &mut [MaybeUninit<T>] {
    |        ^^^^^^^^^^^^^^^^^^^

warning: function `quicksort` is never used
  --> /home/r/src/rust/rustc.2/library/core/src/slice/sort/unstable/quicksort.rs:19:15
   |
19 | pub(crate) fn quicksort<'a, T, F>(
   |               ^^^^^^^^^

warning: `core` (lib) generated 3 warnings
```

However, the cfg stuff here is sufficiently messy that I didn't want to touch more of it. I think all `feature = "optimize_for_size"` should become `any(feature = "optimize_for_size", target_pointer_width = "16")` but I am not entirely certain. Warnings are fine, Miri will just ignore them.

Cc `@Voultapher`
2024-09-25 20:11:00 +02:00
Matthias Krüger
3b2580914b
Rollup merge of #130819 - bjoernager:char-must-use-len-utf, r=Noratrieb
Add `must_use` attribute to `len_utf8` and `len_utf16`.

The `len_utf8` and `len_utf16` methods in `char` should have the `must_use` attribute.

The somewhat similar method `<[T]>::len` has had this attribute since #95274. Considering that these two methods would most likely be used to test the size of a buffer (before a call to `encode_utf8` or `encode_utf16`), *not* using their return values could indicate a bug.

According to ["When to add `#[must_use]`](https://std-dev-guide.rust-lang.org/policy/must-use.html), this is **not** considered a breaking change (and could be reverted again at a later time).
2024-09-25 20:11:00 +02:00
Matthias Krüger
3ee3e063c1
Rollup merge of #130811 - RalfJung:random, r=joboet
add link from random() helper fn to extensive DefaultRandomSource docs
2024-09-25 20:10:59 +02:00
Chris Denton
d3e59a502b
Revert Break into the debugger on panic (129019) 2024-09-25 17:53:57 +00:00
Ralf Jung
8f1ed9b2e2 Utf8Chunks: add link to Utf8Chunk 2024-09-25 19:46:41 +02:00
nora
ded22ea181
Add tracking issue for io_error_inprogress 2024-09-25 17:40:55 +02:00
Ralf Jung
1151eb1c84 fix some cfg logic around optimize_for_size and 16-bit targets 2024-09-25 15:21:08 +02:00
bors
2933f68abe Auto merge of #130816 - matthiaskrgr:rollup-jy25phv, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #130549 (Add RISC-V vxworks targets)
 - #130595 (Initial std library support for NuttX)
 - #130734 (Fix: ices on virtual-function-elimination about principal trait)
 - #130787 (Ban combination of GCE and new solver)
 - #130809 (Update llvm triple for OpenHarmony targets)
 - #130810 (Don't trap into the debugger on panics under Linux)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-25 08:43:14 +00:00
Gabriel Bjørnager Jensen
b466fa6db8 Add 'must_use' attribute to 'char::len_utf8' and 'char::len_utf16'; 2024-09-25 10:42:43 +02:00
Matthias Krüger
9d134cc26a
Rollup merge of #130810 - kromych:master, r=workingjubilee
Don't trap into the debugger on panics under Linux

This breaks `rr`, see https://github.com/rust-lang/rust/pull/129019#issuecomment-2369361278 for the discussion

CC `@khuey` `@workingjubilee`
2024-09-25 10:09:24 +02:00
Matthias Krüger
5b727870fa
Rollup merge of #130595 - no1wudi:master, r=ibraheemdev
Initial std library support for NuttX

This PR add the initial libstd support for NuttX platform (Tier 3), currently it depends on https://github.com/rust-lang/libc/pull/3909 which provide the essential libc definitions.
2024-09-25 10:09:22 +02:00
Matthias Krüger
508b433e27
Rollup merge of #130549 - biabbas:riscv32_wrs_vxworks, r=nnethercote
Add RISC-V vxworks targets

Risc-V 32 and RISC-V 64 targets are to be added in the target list.
2024-09-25 10:09:22 +02:00
Ralf Jung
1fe049ad57 add link from random() helper fn to extensive DefaultRandomSource docs 2024-09-25 08:25:36 +02:00
bors
4c62024cd5 Auto merge of #130803 - cuviper:file-buffered, r=joshtriplett
Add `File` constructors that return files wrapped with a buffer

In addition to the light convenience, these are intended to raise visibility that buffering is something you should consider when opening a file, since unbuffered I/O is a common performance footgun to Rust newcomers.

ACP: https://github.com/rust-lang/libs-team/issues/446
Tracking Issue: #130804
2024-09-25 04:57:12 +00:00
kromych
49d1c3b433 Don't trap into the debugger on panics under Linux
This breaks `rr`, see https://github.com/rust-lang/rust/pull/129019#issuecomment-2369361278
for the discussion

CC @khuey @workingjubilee
2024-09-24 19:52:14 -07:00
Trevor Gross
147aa8611a
Rollup merge of #130789 - aviramha:add_inprogress, r=Noratrieb
add InProgress ErrorKind gated behind io_error_inprogress feature

Follow up on https://github.com/rust-lang/libs-team/issues/92#issuecomment-2371666560
2024-09-24 19:47:51 -04:00
Trevor Gross
9bdef3c928
Rollup merge of #130788 - tgross35:memchr-pinning, r=Noratrieb,Mark-Simulacrum
Pin memchr to 2.5.0 in the library rather than rustc_ast

The latest versions of `memchr` experience LTO-related issues when compiling for windows-gnu [1], so needs to be pinned. The issue is present in the standard library.

`memchr` has been pinned in `rustc_ast`, but since the workspace was recently split, this pin no longer has any effect on library crates.

Resolve this by adding `memchr` as an _unused_ dependency in `std`, pinned to 2.5. Additionally, remove the pin in `rustc_ast` to allow non-library crates to upgrade to the latest version.

Link: https://github.com/rust-lang/rust/issues/127890 [1]

try-job: x86_64-mingw
try-job: x86_64-msvc
2024-09-24 19:47:50 -04:00
Josh Stone
458537ebc0 Add a tracking issue for file_buffered 2024-09-24 15:06:55 -07:00
Josh Stone
0999b019f8 Dogfood feature(file_buffered) 2024-09-24 14:25:16 -07:00
Josh Stone
1e9a50dde8 Pre-allocate buffers in File::open_buffered and create_buffered 2024-09-24 13:33:31 -07:00
Josh Stone
ee129b12ed Add File::open_buffered and create_buffered 2024-09-24 13:32:29 -07:00
bors
363ae41883 Auto merge of #129587 - Voultapher:opt-for-size-variants-of-sort-impls, r=cuviper
Add `optimize_for_size` variants for stable and unstable sort as well as select_nth_unstable

- Stable sort uses a simple merge-sort that re-uses the existing - rather gnarly - merge function.
- Unstable sort jumps directly to the branchless heapsort fallback.
- select_nth_unstable jumps directly to the median_of_medians fallback, which is augmented with a custom tiny smallsort and partition impl.

Some code is duplicated but de-duplication would bring it's own problems. For example `swap_if_less` is critical for performance, if the sorting networks don't inline it perf drops drastically, however `#[inline(always)]` is also a poor fit, if the provided comparison function is huge, it gives the compiler an out to only instantiate `swap_if_less` once and call it. Another aspect that would suffer when making `swap_if_less` pub, is having to cfg out dozens of functions in in smallsort module.

Part of https://github.com/rust-lang/rust/issues/125612

r​? `@Kobzol`
2024-09-24 18:48:08 +00:00
Aviram Hassan
46fd76e9a5
add InProgress ErrorKind gated behind io_error_inprogress feature
Co-authored-by: David Tolnay <dtolnay@gmail.com>
Co-authored-by: nora <48135649+Noratrieb@users.noreply.github.com>
2024-09-24 20:49:56 +03:00