Commit Graph

15869 Commits

Author SHA1 Message Date
bors 1d8f135b20 Auto merge of #128862 - cblh:fix/128855, r=scottmcm
fix:  #128855 Ensure `Guard`'s `drop` method is removed at `opt-level=s` for `…

fix: #128855

…Copy` types

Added `#[inline]` to the `drop` method in the `Guard` implementation to ensure that the method is removed by the compiler at optimization level `opt-level=s` for `Copy` types. This change aims to align the method's behavior with optimization expectations and ensure it does not affect performance.

r​? `@scottmcm`
2024-08-12 05:22:03 +00:00
bors 13f8a57cfb Auto merge of #126793 - saethlin:mono-rawvec, r=scottmcm
Apply "polymorphization at home" to RawVec

The idea here is to move all the logic in RawVec into functions with explicit size and alignment parameters. This should eliminate all the fussing about how tweaking RawVec code produces large swings in compile times.

This uncovered https://github.com/rust-lang/rust-clippy/issues/12979, so I've modified the relevant test in a way that tries to preserve the spirit of the test without tripping the ICE.
2024-08-12 01:47:06 +00:00
Matthias Krüger 2c88eb9805
Rollup merge of #128882 - RalfJung:local-waker-will-wake, r=cuviper
make LocalWaker::will_wake consistent with Waker::will_wake

This mirrors https://github.com/rust-lang/rust/pull/119863 for `LocalWaker`. Looks like that got missed in the initial `LocalWaker` PR (https://github.com/rust-lang/rust/pull/118960).
2024-08-11 07:51:52 +02:00
Matthias Krüger e8f6819db7
Rollup merge of #120314 - mina86:i, r=Mark-Simulacrum
core: optimise Debug impl for ascii::Char

Rather than writing character at a time, optimise Debug implementation
for core::ascii::Char such that it writes the entire representation
with a single write_str call.

With that, add tests for Display and Debug.

Issue: https://github.com/rust-lang/rust/issues/110998
2024-08-11 07:51:49 +02:00
bors 04ba50e823 Auto merge of #128927 - GuillaumeGomez:rollup-ei2lr0f, r=GuillaumeGomez
Rollup of 8 pull requests

Successful merges:

 - #128273 (Improve `Ord` violation help)
 - #128807 (run-make: explaing why fmt-write-bloat is ignore-windows)
 - #128903 (rustdoc-json-types `Discriminant`: fix typo)
 - #128905 (gitignore: Add Zed and Helix editors)
 - #128908 (diagnostics: do not warn when a lifetime bound infers itself)
 - #128909 (Fix dump-ice-to-disk for RUSTC_ICE=0 users)
 - #128910 (Differentiate between methods and associated functions in diagnostics)
 - #128923 ([rustdoc] Stop showing impl items for negative impls)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-10 15:13:38 +00:00
Guillaume Gomez 65875b2f5a
Rollup merge of #128273 - Voultapher:improve-ord-violation-help, r=workingjubilee
Improve `Ord` violation help

Recent experience in #128083 showed that the panic message when an Ord violation is detected by the new sort implementations can be confusing. So this PR aims to improve it, together with minor bug fixes in the doc comments for sort*, sort_unstable* and select_nth_unstable*.

Is it possible to get these changes into the 1.81 release? It doesn't change behavior and would greatly help when users encounter this panic for the first time, which they may after upgrading to 1.81.

Tagging `@orlp`
2024-08-10 16:23:51 +02:00
Nadrieril c256de2253 Update std and compiler 2024-08-10 12:07:17 +02:00
Nadrieril cd40769c02 Stabilize `min_exhaustive_patterns` 2024-08-10 12:07:17 +02:00
Ben Kimock da15248d26 Add an optimizer hint for the capacity that with_capacity_in returns 2024-08-09 20:06:27 -04:00
Ben Kimock 4e98bc6730 Hoist IS_ZST check out of RawVecInner::from_*_in 2024-08-09 20:06:27 -04:00
Ben Kimock d6c0ebef50 Polymorphize RawVec 2024-08-09 20:06:26 -04:00
Michal Nazarewicz 7d1de7f994 core: optimise Debug impl for ascii::Char
Rather than writing character at a time, optimise Debug implementation
for core::ascii::Char such that it writes the entire representation as
with a single write_str call.

With that, add tests for Display and Debug implementations.
2024-08-09 22:50:57 +02:00
Matthias Krüger 2e0c5adf04
Rollup merge of #128859 - MinxuanZ:mips-sig, r=Amanieu
Fix the name of signal 19 in library/std/src/sys/pal/unix/process/process_unix/tests.rs for mips/sparc linux

relate to #128816
2024-08-09 18:24:59 +02:00
Matthias Krüger 53729366a9
Rollup merge of #128817 - biabbas:vxworks_update, r=tgross35
VxWorks code refactored

1. Extern TaskNameSet as minimum supported version of os is VxWorks 7 which would have taskNameSet
2. Vx_TASK_NAME_LEN is 31 on VxWorks7, defined variable res.
3. Add unsafe blocks on Non::Zero usage in available_parallelism()
4. Update vxworks docs.
r? `@tgross35`
cc `@devnexen`
2024-08-09 18:24:56 +02:00
Ralf Jung ae09340350 make LocalWaker::will_wake consistent with Waker::will_wake 2024-08-09 18:05:57 +02:00
Lukas Bergdoll 1be60b5d2b Fix linkchecker issue 2024-08-09 15:05:37 +02:00
Matthias Krüger e88067927a
Rollup merge of #128824 - GuillaumeGomez:update-compiler-builtins, r=Amanieu
Update compiler-builtins version to 0.1.118

r? `@Amanieu`
2024-08-09 05:52:16 +02:00
B I Mohammed Abbas b20d9f0403
VxWorks: Add safety comment for vxCpuEnabledGet
Co-authored-by: Trevor Gross <t.gross35@gmail.com>
2024-08-09 09:05:09 +05:30
burlinchen bca0c5f2a9 fix: Ensure `Guard`'s `drop` method is removed at `opt-level=s` for `Copy` types
Added `#[inline]` to the `drop` method in the `Guard` implementation to ensure that the method is removed by the compiler at optimization level `opt-level=s` for `Copy` types. This change aims to align the method's behavior with optimization expectations and ensure it does not affect performance.
2024-08-09 11:10:30 +08:00
monstercatss 0106f5bcba delete space 2024-08-09 10:12:54 +08:00
monstercatss 625432c837 fix format 2024-08-09 09:36:22 +08:00
Min a3f8edff20 [SPARC] fix the name of signal 19 in sparc arch 2024-08-09 09:21:09 +08:00
Min 11b801bc4e [MIPS] fix the name of signal 19 in mips 2024-08-09 09:21:09 +08:00
Matthias Krüger 5f0461707a
Rollup merge of #128818 - RalfJung:std-miri-floats, r=tgross35
std float tests: special-case Miri in feature detection

Quick work-around to fix miri-test-libstd failures.

r? ``@tgross35``
2024-08-09 00:03:37 +02:00
Matthias Krüger 95b40727bd
Rollup merge of #128640 - RalfJung:rwlock-macos-miri, r=joboet
rwlock: disable 'frob' test in Miri on macOS

Due to https://github.com/rust-lang/rust/issues/121950, Miri will sometimes complain about this test on macOS. Better disable the test, as otherwise it can fail for unrelated PRs.

r? ``@joboet``
2024-08-09 00:03:35 +02:00
Matthias Krüger 127fbc8481
Rollup merge of #128749 - tgross35:float-inline, r=scottmcm
Mark `{f32,f64}::{next_up,next_down,midpoint}` inline

Most float functions are marked `#[inline]` so any float symbols used by these functions only need to be provided if the function itself is used. RFL recently noticed that `next_up`, `next_down`, and `midpoint` for `f32` and `f64` are not inline, which causes linker errors when building with certain configurations <https://lore.kernel.org/all/20240806150619.192882-1-ojeda@kernel.org/>.

Add the missing attributes so the symbols should no longer be required.
2024-08-08 18:57:02 +02:00
Matthias Krüger 3a9dd829d0
Rollup merge of #128306 - WiktorPrzetacznik:WiktorPrzetacznik-nonnull-alignoffset-update, r=Amanieu
Update NonNull::align_offset quarantees

This PR proposes to update [`NonNull::align_offset`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.align_offset) guarantees, which should to be matched with [`ptr::align_offset`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.align_offset-1)
(as `NonNull::align_offset` delegates to `ptr::align_offset`).

[PR #121201](https://github.com/rust-lang/rust/pull/121201) updated only `ptr::align_offset` docs.
2024-08-08 18:57:00 +02:00
Guillaume Gomez 6d69b2e408 Update compiler-builtins version to 0.1.118 2024-08-08 14:47:49 +02:00
Ralf Jung 5d968705b1 std float tests: special-case Miri in feature detection
also fix some cfg logic
2024-08-08 12:17:50 +02:00
B I Mohammed Abbas 2abcc6beeb Vxworks: Extern taskNameSet and fix build errors 2024-08-08 15:16:22 +05:30
Ralf Jung a120fb7031 rwlock: disable 'frob' test in Miri on macOS 2024-08-08 11:15:18 +02:00
B I Mohammed Abbas fb1dac21ff Fix VxWorks available parallelism: Move nonzero::uncheked into unsafe block 2024-08-08 12:59:04 +05:30
Trevor Gross 36b9aee947
Rollup merge of #128800 - clarfonthey:core-pattern-type, r=compiler-errors
Add tracking issue to core-pattern-type

While the actual `pattern_types` feature flag has an issue assigned, the exported macro and its module do not.

cc #123646
2024-08-07 20:49:05 -05:00
Trevor Gross 1d820dc9a6
Rollup merge of #128691 - tgross35:update-builtins, r=Amanieu
Update `compiler-builtins` to 0.1.117

This includes [1] which means we can remove the (nonworking) configuration of `no-f16-f128`.

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

[1]: https://github.com/rust-lang/compiler-builtins/pull/652

try-job: dist-various-1
2024-08-07 20:49:03 -05:00
ltdk 0257f42089 Add tracking issue to core-pattern-type 2024-08-07 20:43:05 -04:00
Matthias Krüger 2ee9678338
Rollup merge of #128261 - clarfonthey:iter-default, r=dtolnay
impl `Default` for collection iterators that don't already have it

There is a pretty strong precedent for implementing `Default` for collection iterators, and this does so for some where this implementation was missed.

I don't think this needs a separate ACP (since this precedent already exists, and these feel like they were just missed), however, it *will* need an FCP since these implementations are instantly stable.
2024-08-07 20:28:16 +02:00
Trevor Gross 6b3feb49c6 Mark `{f32,f64}::{next_up,next_down,midpoint}` inline
Most float functions are marked `#[inline]` so any float symbols used by
these functions only need to be provided if the function itself is used.
RFL recently noticed that `next_up`, `next_down`, and `midpoint` for
`f32` and `f64` are not inline, which causes linker errors when building
with certain configurations [1].

Add the missing attributes so the symbols should no longer be required.

Cc: Gary Guo <gary@garyguo.net>
Reported-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/all/20240806150619.192882-1-ojeda@kernel.org/ [1]
2024-08-07 03:24:55 -05:00
Trevor Gross 701bc03c52
Rollup merge of #128766 - Monadic-Cat:patch-1, r=tgross35
Trivial grammar fix in const keyword docs

This PR makes a trivial fix to the wording of a sentence in the `const` keyword docs.

> `const` items looks remarkably similar to `static` items, [...]

Either this should be written as
> A `const` items looks remarkably similar to a `static` item, [...]

or "looks" should be changed to "look".

I have selected the smaller diff.
2024-08-06 22:17:35 -05:00
Trevor Gross b3bfd66627
Rollup merge of #128417 - tgross35:f16-f128-math, r=dtolnay
Add `f16` and `f128` math functions

This adds intrinsics and math functions for `f16` and `f128` floating point types. Support is quite limited and some things are broken so tests don't run on many platforms, but this provides a starting point.
2024-08-06 22:17:32 -05:00
Monadic Cat f34ff1e05a
Trivial grammar fix in const keyword docs
> `const` items looks remarkably similar to `static` items, [...]

Either this should be written as
> A `const` items looks remarkably similar to a `static` item,

or "looks" should be changed to "look".

I have selected the smaller diff.
2024-08-06 21:59:04 -05:00
Trevor Gross 51e68c3006 Update `compiler-builtins` to 0.1.117
This includes [1] which means we can remove the (nonworking)
configuration of `no-f16-f128`.

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

[1]: https://github.com/rust-lang/compiler-builtins/pull/652
2024-08-06 21:48:32 -05:00
Matthias Krüger 6ed9a33001
Rollup merge of #128751 - devnexen:vxworks_set_thread_name, r=tgross35
std:🧵 set_name implementation proposal for vxWorks.
2024-08-07 00:34:15 +02:00
Matthias Krüger f00a55188f
Rollup merge of #128539 - biabbas:deny_unsafe, r=workingjubilee
Forbid unused unsafe in vxworks-specific std modules

Tracking issue #127747
Adding deny(unsafe_op_in_unsafe_fn) in VxWorks specific files did not cause any error.
Most of VxWorks falls back on Unix libraries. So we'll have to wait for Unix changes.

r? ```@workingjubilee```
2024-08-07 00:34:12 +02:00
Matthias Krüger 7e1360b1e1
Rollup merge of #128406 - lolbinarycat:bufreader_peek, r=Mark-Simulacrum
implement BufReader::peek

Part of https://github.com/rust-lang/rust/issues/128405
2024-08-07 00:34:12 +02:00
Matthias Krüger 16b251be10
Rollup merge of #125048 - dingxiangfei2009:stable-deref, r=amanieu
PinCoerceUnsized trait into core

cc ``@Darksonn`` ``@wedsonaf`` ``@ojeda``

This is a PR to introduce a `PinCoerceUnsized` trait in order to make trait impls generated by the proc-macro `#[derive(SmartPointer)]`, proposed by [RFC](e17e19ac7a/text/3621-derive-smart-pointer.md (pincoerceunsized-1)), sound. There you may find explanation, justification and discussion about the alternatives.

Note that we do not seek stabilization of this `PinCoerceUnsized` trait in the near future. The stabilisation of this trait does not block the eventual stabilization process of the `#[derive(SmartPointer)]` macro. Ideally, use of `DerefPure` is more preferrable except this will actually constitute a breaking change. `PinCoerceUnsized` emerges as a solution to the said soundness hole while avoiding the breaking change. More details on the `DerefPure` option have been described in this [section](e17e19ac7a/text/3621-derive-smart-pointer.md (derefpure)) of the RFC linked above.

Earlier discussion can be found in this [Zulip stream](https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/Pin.20and.20soundness.20of.20unsizing.20coercions) and [rust-for-linux thread](https://rust-lang.zulipchat.com/#narrow/stream/425075-rust-for-linux/topic/.23.5Bderive.28SmartPointer.29.5D.20and.20pin.20unsoundness.20rfc.233621).

try-job: dist-various-2
2024-08-07 00:34:11 +02:00
David Carlier b9e8e99198
std:🧵 set_name implementation proposal for vxWorks. 2024-08-06 21:10:12 +01:00
binarycat 4af77dfea5 implement BufReader::peek 2024-08-05 15:44:54 -04:00
Ralf Jung 212417b87f custom MIR: add support for tail calls 2024-08-05 18:23:14 +02:00
bors 4d48a6be74 Auto merge of #128673 - matthiaskrgr:rollup-gtvpkm7, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #128026 (std:🧵 available_parallelism implementation for vxWorks proposal.)
 - #128471 (rustdoc: Fix handling of `Self` type in search index and refactor its representation)
 - #128607 (Use `object` in `run-make/symbols-visibility`)
 - #128609 (Remove unnecessary constants from flt2dec dragon)
 - #128611 (run-make: Remove cygpath)
 - #128619 (Correct the const stabilization of `<[T]>::last_chunk`)
 - #128630 (docs(resolve): more explain about `target`)
 - #128660 (tests: more crashes)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-05 06:55:50 +00:00
Matthias Krüger 74df517b90
Rollup merge of #128619 - glandium:last_chunk, r=scottmcm
Correct the const stabilization of `<[T]>::last_chunk`

`<[T]>::first_chunk` became const stable in 1.77, but `<[T]>::last_chunk` was left out. This was fixed in 3488679768, which reached stable in 1.80, making `<[T]>::last_chunk` const stable as of that version, but it is documented as being const stable as 1.77. While this is what should have happened, the documentation should reflect what actually did happen.
2024-08-05 08:22:24 +02:00