Commit Graph

267398 Commits

Author SHA1 Message Date
Matthias Krüger
a0ae32d6a2
Rollup merge of #130990 - RalfJung:mir-const-normalize, r=compiler-errors
try to get rid of mir::Const::normalize

It was easy to make this compile, let's see if anything breaks...

r? `@compiler-errors`
2024-09-29 20:17:37 +02:00
Matthias Krüger
a061e566a6
Rollup merge of #130972 - RalfJung:const_cell_into_inner, r=dtolnay
stabilize const_cell_into_inner

This const-stabilizes
- `UnsafeCell::into_inner`
- `Cell::into_inner`
- `RefCell::into_inner`
- `OnceCell::into_inner`

`@rust-lang/wg-const-eval` this uses `rustc_allow_const_fn_unstable(const_precise_live_drops)`, so we'd be comitting to always finding *some* way to accept this code. IMO that's fine -- what these functions do is to move out the only field of a struct, and that struct has no destructor itself. The field's destructor does not get run as it gets returned to the caller.

`@rust-lang/libs-api` this was FCP'd already [years ago](https://github.com/rust-lang/rust/issues/78729#issuecomment-811409860), except that  `OnceCell::into_inner` was added to the same feature gate since then (Cc `@tgross35).` Does that mean we have to re-run the FCP? If yes, I'd honestly prefer to move `OnceCell` into its own feature gate to not risk missing the next release. (That's why it's not great to add new functions to an already FCP'd feature gate.) OTOH if this needs an FCP either way since the previous FCP was so long ago, then we might as well do it all at once.
2024-09-29 20:17:36 +02:00
Matthias Krüger
c1e54cfa40
Rollup merge of #129003 - Voultapher:improve-ord-docs, r=workingjubilee
Improve Ord docs

- Makes wording more clear and re-structures some sections that can be overwhelming for someone not already in the know.
- Adds examples of how *not* to implement Ord, inspired by various anti-patterns found in real world code.

Many of the wording changes are inspired directly by my personal experience of being confused by the `Ord` docs and seeing other people get it wrong as well, especially lately having looked at a number of `Ord` implementations as part of #128899.

Created with help by `@orlp.`

r​? `@workingjubilee`
2024-09-29 20:17:36 +02:00
Matthias Krüger
1d45203779
Rollup merge of #123932 - adamse:global-alloc-safety-preconds-positive, r=tgross35
restate GlobalAlloc method safety preconditions in terms of what the caller has to do for greater clarity
2024-09-29 20:17:35 +02:00
Ralf Jung
ad8a5ce4ca let rustfmt format imports 2024-09-29 19:26:32 +02:00
Michael Howell
c27b54ac4a rustdoc-gui: fix test cases 2024-09-29 10:02:06 -07:00
bors
42ff2eedb0 Auto merge of #131022 - matthiaskrgr:rollup-g9y1v11, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #130931 (Rename `standalone` doctest attribute into `standalone_crate`)
 - #131000 (Weekly `cargo update`)
 - #131011 (cleanup: don't `.into()` identical types)
 - #131013 (cleanup: don't manually `unwrap_or_default()`)
 - #131014 (cleanup: don't clone types that are Copy)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-29 15:52:51 +00:00
Matthias Krüger
71c96cc7d5
Rollup merge of #131014 - matthiaskrgr:no_clone_on_copy, r=chenyukang
cleanup: don't clone types that are Copy
2024-09-29 16:51:56 +02:00
Matthias Krüger
af1e24b946
Rollup merge of #131013 - matthiaskrgr:unwrapordefault, r=jieyouxu
cleanup: don't manually `unwrap_or_default()`
2024-09-29 16:51:56 +02:00
Matthias Krüger
128a7d64f8
Rollup merge of #131011 - matthiaskrgr:no_into, r=jieyouxu
cleanup: don't `.into()` identical types
2024-09-29 16:51:55 +02:00
Matthias Krüger
4bb92599da
Rollup merge of #131000 - rust-lang:cargo_update, r=clubby789
Weekly `cargo update`

Automation to keep dependencies in `Cargo.lock` current.

The following is the output from `cargo update`:

```txt
     Locking 5 packages to latest compatible versions
    Updating autocfg v1.3.0 -> v1.4.0
    Updating flate2 v1.0.33 -> v1.0.34
    Updating portable-atomic v1.8.0 -> v1.9.0
    Updating syn v2.0.77 -> v2.0.79
    Updating tempfile v3.12.0 -> v3.13.0
note: pass `--verbose` to see 81 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 9 unchanged dependencies behind latest

rustbook dependencies:
     Locking 13 packages to latest compatible versions
    Updating autocfg v1.3.0 -> v1.4.0
    Updating cc v1.1.21 -> v1.1.22
    Updating flate2 v1.0.33 -> v1.0.34
    Updating libc v0.2.158 -> v0.2.159
    Updating pkg-config v0.3.30 -> v0.3.31
    Updating redox_syscall v0.5.4 -> v0.5.6
    Updating serde_spanned v0.6.7 -> v0.6.8
    Updating syn v2.0.77 -> v2.0.79
    Updating tempfile v3.12.0 -> v3.13.0
    Updating thiserror v1.0.63 -> v1.0.64
    Updating thiserror-impl v1.0.63 -> v1.0.64
    Updating toml_edit v0.22.21 -> v0.22.22
    Updating winnow v0.6.18 -> v0.6.20
note: pass `--verbose` to see 30 unchanged dependencies behind latest
```
2024-09-29 16:51:55 +02:00
Matthias Krüger
3097951023
Rollup merge of #130931 - GuillaumeGomez:standalone-crate, r=notriddle
Rename `standalone` doctest attribute into `standalone_crate`

Following [zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/Renaming.20code.20block.20.22standalone.22.20attribute.3F) and poll results.

r? `@notriddle`
2024-09-29 16:51:55 +02:00
bors
d194948e50 Auto merge of #130975 - matthiaskrgr:nice_ice_shall_suffice, r=jieyouxu
crashes: more tests

r? `@jieyouxu`
2024-09-29 13:09:08 +00:00
Matthias Krüger
71cd918dc7 cleanup: don't clone types that are Copy 2024-09-29 13:31:30 +02:00
Guillaume Gomez
6f5f21adfc Rename doctest attribute standalone-crate into standalone_crate for coherency 2024-09-29 13:01:41 +02:00
Matthias Krüger
1a28599981 cleanup: don't manually unwrap_or_default() 2024-09-29 12:51:28 +02:00
bors
2da3cb9cab Auto merge of #131012 - GuillaumeGomez:rollup-e9ovh3a, r=GuillaumeGomez
Rollup of 5 pull requests

Successful merges:

 - #130383 (check if it's rust-lang/rust CI job in `llvm::is_ci_llvm_modified`)
 - #130416 (resolve #130122: reword 'sort-by' edge-conditions documentation)
 - #130537 (rustdoc: add doc comment to DocVisitor)
 - #130743 (Clarifications for set_nonblocking methods)
 - #131010 (extend comment in global_llvm_features regarding target-cpu=native)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-09-29 10:44:16 +00:00
Guillaume Gomez
e9c9307d36
Rollup merge of #131010 - RalfJung:target-cpu-native, r=jieyouxu
extend comment in global_llvm_features regarding target-cpu=native

Based on the description in https://github.com/rust-lang/rust/pull/83084 by `@nagisa` -- seems better to have this in the code, where it is easier to find.
2024-09-29 12:37:53 +02:00
Guillaume Gomez
ee8ca3aa6c
Rollup merge of #130743 - YohDeadfall:net-nonblocking-doc, r=Mark-Simulacrum
Clarifications for set_nonblocking methods

Closes #129903.

The issue mentions that `send`, `recv` and other operations are interpreted by some users as methods of `TcpSocket` which led to confusion since it hasn't them. To fix it I added "system" into the documentation as being more precise for two reasons:
* it's makes it clear that these names are system operations;
* it doesn't point to the location of these methods like `libc` because not every system is POSIX compatible.
2024-09-29 12:37:52 +02:00
Guillaume Gomez
ed5d779f44
Rollup merge of #130537 - lolbinarycat:rustdoc-DocVisitor-docs, r=GuillaumeGomez
rustdoc: add doc comment to DocVisitor
2024-09-29 12:37:52 +02:00
Guillaume Gomez
6799b80c79
Rollup merge of #130416 - BatmanAoD:130122-sort-by-docs, r=Mark-Simulacrum
resolve #130122: reword 'sort-by' edge-conditions documentation

See #130122 for rationale & preliminary discussion.
2024-09-29 12:37:51 +02:00
Guillaume Gomez
f39101a5f6
Rollup merge of #130383 - onur-ozkan:ignore-llvm-changes-on-ci-llvm-true, r=Mark-Simulacrum
check if it's rust-lang/rust CI job in `llvm::is_ci_llvm_modified`

Changes `llvm::is_ci_llvm_modified` to only work on rust-lang/rust managed CI.
2024-09-29 12:37:50 +02:00
bors
6abc731f92 Auto merge of #3926 - klensy:deps-up2, r=RalfJung
bump few deps

Bumps few things around `miri-script` reducing deps; bump `chrono-tz`.
2024-09-29 10:24:06 +00:00
Matthias Krüger
e963568585 cleanup: don't .into() identical types 2024-09-29 12:18:11 +02:00
Ralf Jung
a78fd694d4 extend comment in global_llvm_features regarding target-cpu=native handling 2024-09-29 12:16:35 +02:00
Matthias Krüger
6d3aee2ab6 crashes: more tests 2024-09-29 11:58:09 +02:00
klensy
3e4f64c44f bump few deps 2024-09-29 12:51:26 +03:00
klensy
33f637c577 add title to compiler update 2024-09-29 11:36:00 +03:00
bors
329e7b4d4e Auto merge of #130983 - GuillaumeGomez:wait-for-false, r=notriddle
Update `browser-ui-test` version and make use of `wait-for*-false` commands

I added `wait-for*-false` commands, making possible these changes.

r? `@notriddle`
2024-09-29 08:22:20 +00:00
bors
c38fa99120 Auto merge of #3925 - RalfJung:solarish-random, r=RalfJung
skip old getrandom crate on Solaris

Fixes https://github.com/rust-lang/miri/issues/3924

Now we should be able to enable randomness tests on Solarish (and Android, while we are at it).
2024-09-29 07:35:38 +00:00
Ralf Jung
ab8fa80746 skip old getrandom crate on Solaris 2024-09-29 09:34:00 +02:00
Lukas Bergdoll
a67d3bdfe0 Remove duplicate section 2024-09-29 09:32:03 +02:00
Ralf Jung
7eedb6846c adjust test 2024-09-29 08:49:37 +02:00
bors
9903b256a2 Auto merge of #128321 - BatmanAoD:catch-unwind-doc-update, r=Mark-Simulacrum
Update `catch_unwind` doc comments for `c_unwind`

Updates `catch_unwind` doc comments to indicate that catching a foreign exception _will no longer_ be UB. Instead, there are two possible behaviors, though it is not specified which one an implementation will choose.

Nominated for t-lang to confirm that they are okay with making such a promise based on t-opsem FCP, or whether they would like to be included in the FCP.

Related: https://github.com/rust-lang/rust/issues/74990, https://github.com/rust-lang/rust/issues/115285, https://github.com/rust-lang/reference/pull/1226
2024-09-29 05:54:47 +00:00
Ralf Jung
e1c09ec9a5 fix cranelift CI 2024-09-29 07:32:08 +02:00
onur-ozkan
5840d8791c in llvm::is_ci_llvm_modified, check if it's rust-lang/rust CI job
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-29 07:20:19 +03:00
onur-ozkan
2d85139f87 create CiEnv::is_rust_lang_managed_ci_job
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-29 07:19:23 +03:00
bors
1d9162bced Auto merge of #129687 - Urgau:rfc3127-sysroot-2, r=jieyouxu
Implement RFC3137 trim-paths sysroot changes - take 2

This PR is a continuation of https://github.com/rust-lang/rust/pull/118149. Nothing really changed, except for https://github.com/rust-lang/rust/pull/129408 which I was able to trigger locally.

Original description:

> Implement parts of #111540
>
> Right now, backtraces into sysroot always shows /rustc/$hash in diagnostics, e.g.
>
> ```
> thread 'main' panicked at 'hello world', map-panic.rs:2:50
> stack backtrace:
>    0: std::panicking::begin_panic
>              at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:616:12
>    1: map_panic::main::{{closure}}
>              at ./map-panic.rs:2:50
>    2: core::option::Option<T>::map
>              at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/option.rs:929:29
>    3: map_panic::main
>              at ./map-panic.rs:2:30
>    4: core::ops::function::FnOnce::call_once
>              at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5
> note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
> ```
>
> [RFC 3127 said](https://rust-lang.github.io/rfcs/3127-trim-paths.html#changing-handling-of-sysroot-path-in-rustc)
>
> > We want to change this behaviour such that, when rust-src source files can be discovered, the virtual path is discarded and therefore the local path will be embedded, unless there is a --remap-path-prefix that causes this local path to be remapped in the usual way.
>
> This PR implements this behaviour. When `rust-src` is present at compile time, rustc replaces /rustc/$hash with a real path into local rust-src with best effort. To sanitise this, users must explicitly supply `--remap-path-prefix=<path to rust-src>=foo`.

cc `@cbeuw`
Fix #105907
Fix #85463

try-job: dist-x86_64-linux
try-job: x86_64-msvc
try-job: dist-x86_64-msvc
try-job: armhf-gnu
2024-09-29 03:04:05 +00:00
Nicola Krumschmidt
87f17f3ccb
Fix std tests for wasm32-wasip2 target 2024-09-29 04:48:13 +02:00
Nicola Krumschmidt
3b11c82a3d
Hook up std::net to wasi-libc on wasm32-wasip2 target 2024-09-29 04:48:12 +02:00
Frank Steffahn
6683c0416c Adjust spacings and sizing to improve behavior with over-long names 2024-09-29 04:29:08 +02:00
github-actions
bfc9951fa8 cargo update
Locking 5 packages to latest compatible versions
    Updating autocfg v1.3.0 -> v1.4.0
    Updating flate2 v1.0.33 -> v1.0.34
    Updating portable-atomic v1.8.0 -> v1.9.0
    Updating syn v2.0.77 -> v2.0.79
    Updating tempfile v3.12.0 -> v3.13.0
note: pass `--verbose` to see 81 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 9 unchanged dependencies behind latest

rustbook dependencies:
     Locking 13 packages to latest compatible versions
    Updating autocfg v1.3.0 -> v1.4.0
    Updating cc v1.1.21 -> v1.1.22
    Updating flate2 v1.0.33 -> v1.0.34
    Updating libc v0.2.158 -> v0.2.159
    Updating pkg-config v0.3.30 -> v0.3.31
    Updating redox_syscall v0.5.4 -> v0.5.6
    Updating serde_spanned v0.6.7 -> v0.6.8
    Updating syn v2.0.77 -> v2.0.79
    Updating tempfile v3.12.0 -> v3.13.0
    Updating thiserror v1.0.63 -> v1.0.64
    Updating thiserror-impl v1.0.63 -> v1.0.64
    Updating toml_edit v0.22.21 -> v0.22.22
    Updating winnow v0.6.18 -> v0.6.20
note: pass `--verbose` to see 30 unchanged dependencies behind latest
2024-09-29 00:22:29 +00:00
bors
55cb7359c7 Auto merge of #123778 - jhorstmann:optimize-upper-lower-auto-vectorization, r=the8472
Improve autovectorization of to_lowercase / to_uppercase functions

Refactor the code in the `convert_while_ascii` helper function to make it more suitable for auto-vectorization and also process the full ascii prefix of the string. The generic case conversion logic will only be invoked starting from the first non-ascii character.

The runtime on a microbenchmark with a small ascii-only input decreases from ~55ns to ~18ns per iteration. The new implementation also reduces the amount of unsafe code and encapsulates all unsafe inside the helper function.

Fixes #123712
2024-09-28 23:56:37 +00:00
Trevor Gross
2511cc1d15 Enable f16 tests on x86 Apple platforms
These were disabled because Apple uses a special ABI for `f16`.
`compiler-builtins` merged a fix for this in [1], which has since
propagated to rust-lang/rust. Enable tests since there should be no
remaining issues on these platforms.

[1]: https://github.com/rust-lang/compiler-builtins/pull/675
2024-09-28 19:25:41 -04:00
binarycat
5ef63ec3b4 rustdoc: add doc comment to DocVisitor 2024-09-28 19:21:37 -04:00
bors
ed04567ba1 Auto merge of #129385 - tgross35:more-platforms-enable-f16, r=Mark-Simulacrum
Enable `f16` tests on platforms that were missing conversion symbols

The only requirement for `f16` support, aside from LLVM not crashing and no ABI issues, is that symbols to convert to and from `f32` are available. Since the update to compiler-builtins in https://github.com/rust-lang/rust/pull/125016, we now provide these on all platforms.

This also enables `f16` math since there are no further requirements.

Still excluded are platforms for which LLVM emits infinitely-recursing code.

try-job: arm-android
try-job: test-various
try-job: x86_64-fuchsia
2024-09-28 20:15:04 +00:00
Urgau
3a6c6ee3d3 remap-path-prefix-sysroot: remap {{src-base}} as well
This is done to cover the path of the test it-self as it may not live
on the same root directory as {{rust-src-base}}, which can be the case
if {{rust-src-base}} is coming from a extracted dist build (cc opt-dist)
2024-09-28 21:50:23 +02:00
Urgau
37ea27c741 compiletest: normalize to $SRC_DIR_REAL before $TEST_BUILD_DIR
in case the real paths into the libstd/libcore are located inside the
the build directory, maybe because it's coming from an extracted dist
component in the build dir (cc opt-dist)
2024-09-28 21:44:44 +02:00
bors
dd572c4346 Auto merge of #3918 - devnexen:solaris_arc4random_buf, r=RalfJung
implements arc4random_buf shim for freebsd/solarish platforms.

close #3914
2024-09-28 19:36:05 +00:00
Ralf Jung
7cb5a799af make sure the new function is tested 2024-09-28 21:34:27 +02:00