Commit Graph

267590 Commits

Author SHA1 Message Date
Mads Marquart
8964c48726 Add run-make test to check the SDK version(s) that rustc produces 2024-09-29 14:45:09 +02:00
Mads Marquart
0bebedd799 Document a bit more how the SDK version actually works 2024-09-29 14:45:08 +02: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
Yuri Astrakhan
f7d5d9d892 Convert &Option<T> to Option<&T> 2024-09-28 19:51:02 -04: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
Samuel Moelius
b3cf448761 Adjust comment 2024-09-28 16:30:31 -04:00
bors
7b566c214e Auto merge of #13336 - nyurik:ref-option-sig, r=llogiq
Suggest `Option<&T>` instead of `&Option<T>`

closes #13054

```rust
// bad code
fn foo(a: &Option<T>) {}
fn bar(&self) -> &Option<T> {}

// Use instead
fn foo(a: Option<&T>) {}
fn bar(&self) -> Option<&T> {}
```

Handles argument types and return types in functions, methods, and closures with explicit types.  Honors `avoid_breaking_exported_api` parameter.

See this great [YouTube video](https://www.youtube.com/watch?v=6c7pZYP_iIE) with the in-depth explanation.

### Open Questions
These are not blocking, and could be done in separate PRs if needed.
* [ ] Should `&Option<Box<T>>` be suggested as `Option<&T>` -- without the box?  Handled by [clippy::borrowed_box](https://rust-lang.github.io/rust-clippy/master/index.html#/borrowed_box)
* [ ] Should `&Option<String>` be suggested as `Option<&str>` -- using de-refed type?

### Possible Future Improvements
These cases might also be good to handle, probably in a separate PR.

```rust
fn lambdas() {
  let x = |a: &Option<String>| {};
  let x = |a: &Option<String>| -> &Option<String> { todo!() };
}

fn mut_ref_to_ref(a: &mut &Option<u8>) {}
```

changelog: [`ref_option`]: Suggest `Option<&T>` instead of `&Option<T>`
2024-09-28 20:16:10 +00: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
Ralf Jung
c55c4c9f9d tweak Const::identity_unevaluated name and docs 2024-09-28 21:28:08 +02:00
bors
897f0e4749 Auto merge of #13471 - y21:issue13466-fp, r=llogiq
Remove method call receiver special casing in `unused_async` lint

Fixes the false positive mentioned in https://github.com/rust-lang/rust-clippy/issues/13466#issuecomment-2380025514.

The false negative in the OP would be nice to fix too, but I'd rather do that in a separate PR because it's much more involved

Before this change, the `unused_async` lint would check if the async fn is also used anywhere and avoid linting if so. The exception is if the async function is immediately called, because the returned future handling can be easily removed (and also if we don't have some exceptions then the lint wouldn't trigger anywhere) *or* if it's a method call receiver.

I'm not exactly sure why I implemented that special casing for method call receivers in #11200, but it doesn't make much sense in hindsight imo. Especially given that method calls are essentially equivalent to function calls with the receiver as the first argument, which was the primary motivation for not linting in the first place (async fn passed to another function, like `axum::get(handler)` where handler has to be an async fn).

changelog: none
2024-09-28 19:18:56 +00:00
Ralf Jung
921a5ef6d7 try to get rid of mir::Const::normalize 2024-09-28 21:15:18 +02:00
David Carlier
f14f72eb34
implements arc4random_buf shim for freebsd/solarish platforms.
close #3914
2024-09-28 20:02:54 +01:00
Yuri Astrakhan
10e02cf8e3 suggest &str 2024-09-28 13:17:29 -04:00
bors
a1fd235180 Auto merge of #130792 - tgross35:update-builtins, r=Amanieu
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 17:13:22 +00:00
Yuri Astrakhan
38295a0d8a update docs 2024-09-28 13:01:51 -04:00
Guillaume Gomez
632fed891d Improve mistyped docblock attribute warning messages 2024-09-28 18:38:11 +02:00