Commit Graph

13142 Commits

Author SHA1 Message Date
bors
bf2637f4e8 Auto merge of #119954 - scottmcm:option-unwrap-failed, r=WaffleLapkin
Split out `option::unwrap_failed` like we have `result::unwrap_failed`

...and like `option::expect_failed`
2024-01-16 15:32:39 +00:00
bors
67e7b84425 Auto merge of #119987 - matthiaskrgr:rollup-f7lkx4w, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #119818 (Silence some follow-up errors [3/x])
 - #119870 (std: Doc blocking behavior of LazyLock)
 - #119897 (`OutputTypeParameterMismatch` -> `SignatureMismatch`)
 - #119963 (Fix `allow_internal_unstable` for `(min_)specialization`)
 - #119971 (Use `zip_eq` to enforce that things being zipped have equal sizes)
 - #119974 (Minor `trimmed_def_paths` improvements)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-01-15 16:45:41 +00:00
bors
1ead4761e9 Auto merge of #119878 - scottmcm:inline-always-unwrap, r=workingjubilee
Tune the inlinability of `unwrap`

Fixes #115463
cc `@thomcc`

This tweaks `unwrap` on ~~`Option` &~~ `Result` to be two parts:
- `#[inline(always)]` for checking the discriminant
- `#[cold]` for actually panicking

The idea here is that checking the discriminant on a `Result` ~~or `Option`~~ should always be trivial enough to be worth inlining, even in `opt-level=z`, especially compared to passing it to a function.

As seen in the issue and codegen test, this will hopefully help particularly for things like `.try_into().unwrap()`s that are actually infallible, but in a way that's only visible with the inlining.

EDIT: I've restricted this to `Result` to avoid combining effects
2024-01-15 09:20:46 +00:00
Matthias Krüger
6f2670da7b
Rollup merge of #119870 - behnam-oneschema:lazylock-blocking-1, r=tgross35,ChrisDenton
std: Doc blocking behavior of LazyLock

Adding notes about blocking behavior of calls that can block the current thread, similar to those on https://doc.rust-lang.org/std/sync/struct.OnceLock.html

I'm not sure if the "This method never blocks." counterparts would be desired. If so, can add those, as well.
2024-01-15 08:44:48 +01:00
bors
30dfb9e046 Auto merge of #119970 - GuillaumeGomez:rollup-p53c19o, r=GuillaumeGomez
Rollup of 3 pull requests

Successful merges:

 - #119561 (rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 5))
 - #119742 (ARMv6K HorizonOS - Fix backlog for UnixListener)
 - #119960 (Inline 2 functions that appear in dep-graph profiles.)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-01-14 21:15:48 +00:00
Scott McMurray
23483664a2 Split out option::unwrap_failed like we have result::unwrap_failed
...and like `option::expect_failed`
2024-01-14 12:45:01 -08:00
Guillaume Gomez
e401754717
Rollup merge of #119742 - Meziu:armv6k-nintendo-3ds, r=Mark-Simulacrum
ARMv6K HorizonOS - Fix backlog for UnixListener

Simple `#[cfg]` fix to avoid using `libc::SOMAXCONN`, which isn't defined for the `armv6k-nintendo-3ds` target.

Edit: This is similar to #119632.
2024-01-14 20:17:23 +01:00
bors
665d2c6f2c Auto merge of #119796 - androm3da:bcain/compiler_builtins_0_1_105, r=Mark-Simulacrum
Update compiler_builtins to 0.1.105

This provides the builtins for the hexagon architecture.
2024-01-14 19:15:37 +00:00
Behnam Esfahbod
a596159dca std: Doc blocking behavior of LazyLock methods 2024-01-14 10:28:13 -08:00
Guillaume Gomez
a9146ce683
Rollup merge of #119949 - clubby789:spec-newtype-comment, r=nnethercote
Add note on SpecOptionPartialEq to `newtype_index`

https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.60SpecOptionPartialEq.60.20error

r? `@nnethercote`
2024-01-14 14:02:29 +01:00
clubby789
4ca6342eb3 Add note on SpecOptionPartialEq to newtype_index 2024-01-14 00:24:39 +00:00
Matthias Krüger
3a33a4b8f5
Rollup merge of #119935 - joboet:move_pal_personality, r=ChrisDenton
Move personality implementation out of PAL

The module already follows the new convention described in #117276. This PR also includes a small fix in the tidy pal check, that was just an oversight in #117285.
2024-01-13 22:35:09 +01:00
joboet
cb052d57b3
std: move personality implementation out of PAL 2024-01-13 18:30:44 +01:00
bors
c6c4abf584 Auto merge of #119927 - matthiaskrgr:rollup-885ws57, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #119587 (Varargs support for system ABI)
 - #119891 (rename `reported_signature_mismatch` to reflect its use)
 - #119894 (Allow `~const` on associated type bounds again)
 - #119896 (Taint `_` placeholder types in trait impl method signatures)
 - #119898 (Remove unused `ErrorReporting` variant from overflow handling)
 - #119902 (fix typo in `fn()` docs)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-01-13 16:09:45 +00:00
bors
1d8d7b16cb Auto merge of #117285 - joboet:move_platforms_to_pal, r=ChrisDenton
Move platform modules into `sys::pal`

This is the initial step of #117276. `sys` just re-exports everything from the current `sys` for now, I'll move the implementations for the individual features one-by-one after this PR merges.
2024-01-13 14:10:56 +00:00
Matthias Krüger
f53caa1106
Rollup merge of #119902 - asquared31415:patch-1, r=the8472
fix typo in `fn()` docs
2024-01-13 15:10:30 +01:00
joboet
0cfc995814
don't break a good link
Co-authored-by: klensy <klensy@users.noreply.github.com>
2024-01-13 09:18:36 +01:00
asquared31415
51afc0922c
fix typo in fn() docs 2024-01-12 15:51:18 -05:00
bors
2319be8e26 Auto merge of #119452 - AngelicosPhosphoros:make_nonzeroint_get_assume_nonzero, r=scottmcm
Add assume into `NonZeroIntX::get`

LLVM currently don't support range metadata for function arguments so it fails to optimize non zero integers using their invariant if they are provided using by-value function arguments.

Related to https://github.com/rust-lang/rust/issues/119422
Related to https://github.com/llvm/llvm-project/issues/76628
Related to https://github.com/rust-lang/rust/issues/49572
2024-01-12 20:18:04 +00:00
Scott McMurray
b858c591dd Tune the inlinability of Result::unwrap 2024-01-12 10:57:58 -08:00
bors
5431404b87 Auto merge of #118548 - Enselic:bench-padding, r=thomcc,ChrisDenton
libtest: Fix padding of benchmarks run as tests

### Summary

The first commit adds regression tests for libtest padding.

The second commit fixes padding for benches run as tests and updates the blessed output of the regression tests to make it clear what effect the fix has on padding.

Closes #104092 which is **E-help-wanted** and **regression-from-stable-to-stable**

### More details

Before this fix we applied padding _before_ manually doing what `convert_benchmarks_to_tests()` does which affects padding calculations. Instead use `convert_benchmarks_to_tests()` first if applicable and then apply padding afterwards so it becomes correct.

Benches should only be padded when run as benches to make it easy to compare the benchmark numbers. Not when run as tests.

r? `@ghost` until CI passes.
2024-01-12 05:06:03 +00:00
bors
6029085a6f Auto merge of #119430 - NCGThompson:int-pow-bench, r=cuviper
Add Benchmarks for int_pow Methods.

There is quite a bit of room for improvement in performance of the `int_pow` family of methods. I added benchmarks for those functions. In particular, there are benchmarks for small compile-time bases to measure the effect of  #114390. ~~I added a lot (245), but all but 22 of them are marked with `#[ignore]`. There are a lot of macros, and I would appreciate feedback on how to simplify them.~~

~~To run benches relevant to #114390, use `./x bench core --stage 1 -- pow_base_const --include-ignored`.~~
2024-01-12 03:04:45 +00:00
joboet
7c436a8af4
update paths in comments 2024-01-12 00:11:33 +01:00
joboet
d6efeadb06
std: fix module references on Windows 2024-01-11 20:26:20 +01:00
joboet
411f34b782
std: fix module references on UNIX 2024-01-11 20:26:06 +01:00
joboet
cac470cde1
std: fix module references on UEFI 2024-01-11 20:21:05 +01:00
joboet
4ab475dfb5
std: fix module reference on SGX 2024-01-11 20:18:17 +01:00
joboet
4da4958099
std: fix module references on hermit 2024-01-11 20:16:09 +01:00
joboet
99128b7e45
std: begin moving platform support modules into pal 2024-01-11 20:10:25 +01:00
Nicholas Thompson
c65c35b3ef Reduced amount of int_pow benches
Also simplified the macros
2024-01-11 14:00:01 -05:00
Matthias Krüger
b3d15ebb08
Rollup merge of #119853 - klensy:rustfmt-ignore, r=cuviper
rustfmt.toml: don't ignore just any tests path, only root one

Previously ignored any `tests` path, now only /tests at repo root.

For reference, https://git-scm.com/docs/gitignore#_pattern_format
2024-01-11 19:42:53 +01:00
Matthias Krüger
1a4d3c9c47
Rollup merge of #119845 - RalfJung:rint, r=nagisa
rint: further doc tweaks

r? ``@nagisa``
2024-01-11 19:42:52 +01:00
Matthias Krüger
6beb676990
Rollup merge of #119836 - hi-rustin:rustin-patch-docs-blank-line, r=ChrisDenton
chore: remove unnecessary blank line

It seems no need to add an unnecessary line here.
2024-01-11 19:42:50 +01:00
Nicholas Thompson
7dcce97686 Edited int_pow micro-benchmarks 2024-01-11 11:30:12 -05:00
Nicholas Thompson
33a47df84a Added int_pow micro-benchmarks 2024-01-11 11:30:12 -05:00
Nicholas Thompson
7c28a50a3a removed nonfunctioning benchmark
It could also have been fixed by removing a semicolon instead.
2024-01-11 11:30:12 -05:00
Ralf Jung
6b6f2a5a28 rint: further doc tweaks 2024-01-11 13:33:27 +01:00
klensy
aa696c5a22 apply fmt 2024-01-11 15:04:48 +03:00
Matthias Krüger
f92cde4f9a
Rollup merge of #119804 - tmccombs:stabilize-unpoison, r=cuviper
Stabilize mutex_unpoison feature

Closes #96469

`@rustbot` +T-libs-api
2024-01-11 03:02:44 +01:00
hi-rustin
784b50cece chore: remove unnecessary blank line
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2024-01-11 09:45:21 +08:00
Jakub Stasiak
4621357d14 Make is_global/is_unicast_global special address handling complete
IANA explicitly documents 192.0.0.9/32, 192.0.0.9/32 and 2001:30::/28 as
globally reachable[1][2] and the is_global implementations declare
following IANA so let's make this happen.

In case of 2002::/16 IANA says N/A so I think it's safe to say we
shouldn't return true there either.

[1] https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
[2] https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
2024-01-11 01:03:34 +01:00
Thayne McCombs
1ed855dedf Stabilize mutex_unpoison feature
Closes #96469

@rustbot +T-libs-api
2024-01-10 02:34:34 -07:00
Matthias Krüger
3fcddf19e7
Rollup merge of #119782 - RalfJung:rint, r=cuviper
rint intrinsics: caution against actually trying to check for floating-point exceptions
2024-01-10 06:28:45 +01:00
Brian Cain
d5c39d0638 Update compiler_builtins to 0.1.105
This provides the builtins for the hexagon architecture.
2024-01-09 20:30:56 -08:00
Ralf Jung
fa5bef849e rint intrinsics: caution against actually trying to check for floating-point exceptions 2024-01-09 22:19:25 +01:00
bors
190f4c9611 Auto merge of #116846 - krtab:slice_compare_no_memcmp_opt, r=the8472
A more efficient slice comparison implementation for T: !BytewiseEq

(This is a follow up PR on #113654)

This PR changes the implementation for `[T]` slice comparison when `T: !BytewiseEq`. The previous implementation using zip was not optimized properly by the compiler, which didn't leverage the fact that both length were equal. Performance improvements are for example 20% when testing that `[Some(0_u64); 4096].as_slice() == [Some(0_u64); 4096].as_slice()`.
2024-01-09 20:52:34 +00:00
Guillaume Gomez
d61b92f154
Rollup merge of #119768 - ojeda:panic-link, r=Nilstrieb
core: panic: fix broken link
2024-01-09 17:52:22 +01:00
Guillaume Gomez
87b0de6cb7
Rollup merge of #118645 - Patryk27:bump-compiler-builtins, r=Nilstrieb,dtolnay
chore: Bump compiler_builtins

Actually closes https://github.com/rust-lang/rust/issues/118079.
2024-01-09 17:52:20 +01:00
Guillaume Gomez
5e75d46b67
Rollup merge of #118241 - fortanix:raoul/gh-530-make_userspace_types_send, r=Nilstrieb,dtolnay
Making `User<T>` and `User<[T]>` `Send`

All `User` types in SGX point to owned memory in userspace. Special care is always needed when accessing this memory as it must be assumed that an attacker is always able to change its content. Therefore, we can also easily transfer this memory between thread boundaries.

cc: ``@mzohreva`` ``@vn971`` ``@belalH`` ``@jethrogb``
2024-01-09 17:52:19 +01:00
Miguel Ojeda
18a1ca6a17 core: panic: fix broken link
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-01-09 14:15:45 +01:00