Commit Graph

303456 Commits

Author SHA1 Message Date
Kornel
01fdafc9aa Hint that choose_pivot returns index in bounds 2025-07-23 12:01:44 +01:00
Folkert de Vries
75fc5ceefb Merge pull request #1882 from klensy/deps
drop few unused deps
2025-07-23 10:22:11 +00:00
bors
5a30e4307f Auto merge of #143412 - Kobzol:std-detect-in-stdlib, r=Amanieu
Move `std_detect` into stdlib

This PR moves the `std_detect` crate from `stdarch` to be a part of rust-lang/rust instead.

The first commit actually moves the whole directory from the stdarch Josh subtree, so that git blame history is kept intact. Then I had to make a few changes to appease `tidy`.

The most complex thing here is porting the tests. We can't have `std_detect` both in r-l/r and stdarch, because they could get desynchronized, so we have to perform the move more or less "atomically", which means that we also have to port all the existing `std_detect` tests from the `stdarch` repository.

The stdarch repo runs the following `std_detect` tests:

### Build
The `build-std-detect.sh` script (e2b6512aed/ci/build-std-detect.sh) builds `std_detect` using the nightly compiler for several targets. This will be subsumed by normal `x build library` on our Tier 1/2 targets. However, the stdarch repository also tests the following targets:
- aarch64-unknown-freebsd
- armv6-unknown-freebsd
- powerpc-unknown-freebsd
- powerpc64-unknown-freebsd
- aarch64-unknown-openbsd

Which we don't build/test on our CI currently. I think we have mostly two options here:
1) Ignore these targets
2) Create a special CI job that will build stage 1 rustc and then cross-compile std (or just the `std_detect` crate?) for these targets.

### Documentation
The `dox.sh` script (3fec5adcd5/ci/dox.sh) builds and documents `std_detect` for several targets. All of them are Tier 2/we have `dist-` jobs for them, so I think that we can just skip this and let our normal CI subsume it?

### Tests
The `run.sh` script (1b201cec2c/ci/run.sh) runs `cargo test` on `std_detect` with a bunch of variations of feature flags. This will be subsumed by `x test library` in our CI. The only problem is that `stdarch` runs these tests for a ludicrous number of targets:
```
        - tuple: i686-unknown-linux-gnu
        - tuple: x86_64-unknown-linux-gnu
        - tuple: arm-unknown-linux-gnueabihf
        - tuple: armv7-unknown-linux-gnueabihf
        - tuple: aarch64-unknown-linux-gnu
        - tuple: aarch64_be-unknown-linux-gnu
        - tuple: riscv32gc-unknown-linux-gnu
        - tuple: riscv64gc-unknown-linux-gnu
        - tuple: powerpc-unknown-linux-gnu
        - tuple: powerpc64-unknown-linux-gnu
        - tuple: powerpc64le-unknown-linux-gnu
        - tuple: s390x-unknown-linux-gnu
        - tuple: i586-unknown-linux-gnu
        - tuple: nvptx64-nvidia-cuda
        - tuple: thumbv6m-none-eabi
        - tuple: thumbv7m-none-eabi
        - tuple: thumbv7em-none-eabi
        - tuple: thumbv7em-none-eabihf
        - tuple: loongarch64-unknown-linux-gnu
        - tuple: wasm32-wasip1
        - tuple: x86_64-apple-darwin
        - tuple: x86_64-apple-ios-macabi
        - tuple: aarch64-apple-darwin
        - tuple: aarch64-apple-ios-macabi
        - tuple: x86_64-pc-windows-msvc
        - tuple: i686-pc-windows-msvc
        - tuple: aarch64-pc-windows-msvc
        - tuple: x86_64-pc-windows-gnu
        - tuple: aarch64-unknown-linux-gnu
        - tuple: aarch64_be-unknown-linux-gnu
        - tuple: armv7-unknown-linux-gnueabihf
        - tuple: loongarch64-unknown-linux-gnu
        - tuple: powerpc-unknown-linux-gnu
        - tuple: powerpc64-unknown-linux-gnu
        - tuple: powerpc64le-unknown-linux-gnu
        - tuple: riscv32gc-unknown-linux-gnu
        - tuple: riscv64gc-unknown-linux-gnu
        - tuple: s390x-unknown-linux-gnu
        - tuple: x86_64-unknown-linux-gnu
        - tuple: aarch64-apple-darwin
        - tuple: aarch64-apple-ios-macabi
```
We definitely do not run *tests* for all of these targets on our CI.

# Outcome
We have decided to just subsume std_detect tests by our normal test suite for now, and not create a separate CI job. Therefore, this PR performs the following changes in target testing for `std_detect`:

The following T3 targets would go from "build" to "nothing":
```
aarch64-unknown-freebsd (T3)
armv6-unknown-freebsd (T3)
powerpc-unknown-freebsd (T3)
powerpc64-unknown-freebsd (T3)
aarch64-unknown-openbsd (T3)
```

The following T3 targets would go from "test" to "nothing":
```
aarch64_be-unknown-linux-gnu (T3)
riscv32gc-unknown-liux-gnu (T3)
```

The following T2 targets would go from "test" to "build":
```
arm-unknown-linux-gnueabihf (T2)
armv7-unknown-linux-gnueabihf (T2)
riscv64gc-unknown-linux-gnu (T2)
powerpc-unknown-linux-gnu (T2)
powerpc64-unknown-linux-gnu (T2)
powerpc64le-unknown-linux-gnu (T2)
s390x-unknown-linux-gnu (T2)
i586-unknown-linux-gnu (T2)
loongarch64-unknown-linux-gnu (T2)
wasm32-wasip1 (T2)
x86_64-apple-ios-macabi (T2)
aarch64-apple-ios-macabi (T2)
aarch64-pc-windows-msvc (T2)
armv7-unknown-linux-gnueabihf (T2)
loongarch64-unknown-linux-gnu (T2)
powerpc-unknown-linux-gnu (T2)
```

I have confirmed in https://github.com/rust-lang/stdarch/pull/1873 that the current version of this PR would pass stdarch's CI testsuite.

r? `@ghost`

try-job: armhf-gnu
try-job: arm-android
2025-07-23 09:52:16 +00:00
Trevor Gross
08bca4d6a2 ci: Add native PowerPC64LE and s390x jobs
We now have access to native runners, so make use of them for these
architectures. The existing ppc64le Docker job is kept for now.
2025-07-23 04:50:41 -05:00
klensy
d8bf6c48a4 bump serde_with. Weird that it works without std feature, but 2025-07-23 12:22:33 +03:00
klensy
cb27ff0715 remove unused deps 2025-07-23 11:40:44 +03:00
Ralf Jung
037b2f6736 Merge pull request #4479 from RalfJung/ci-win-arm
CI: add windows-arm runner
2025-07-23 08:17:52 +00:00
Jakub Beránek
a61657e9d4 Remove Josh code from miri-script 2025-07-23 09:45:48 +02:00
Jakub Beránek
6c96e7a550 Update josh sync documentation
Now all our Josh subtrees should be using josh-sync.
2025-07-23 09:42:33 +02:00
Jakub Beránek
a6c10939ac Init josh-sync config file 2025-07-23 09:24:52 +02:00
Scott McMurray
6a5c7e0415 No longer need allocas for consuming Result<!, i32> and similar
In optimized builds GVN gets rid of these already, but in `opt-level=0` we actually make `alloca`s for this, which particularly impacts `?`-style things that use actually-only-one-variant types like this.
2025-07-23 00:09:36 -07:00
Ralf Jung
de1b999ff6 atomicrmw on pointers: move integer-pointer cast hacks into backend 2025-07-23 08:32:55 +02:00
Ralf Jung
efcae7d31d properly use caller-side panic location for some GenericArgs methods 2025-07-23 08:32:55 +02:00
Ralf Jung
08d77873df CI: add windows-arm runner 2025-07-23 08:23:48 +02:00
Ayush Singh
eb9c65476c std: net: uefi: Add support to query connection data
- Use EFI_TCP4_GET_MODE_DATA to be able to query for ttl, nodelay,
  peer_addr and socket_addr.
- peer_addr is needed for implementation of `accept`.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-07-23 11:23:41 +05:30
A4-Tacks
1023edc49c Change rename self to parameter use Self type
And add `&self` lifetime support

Example
===

Rename to `this`

```rust
struct Foo<T>(T);
impl Foo<i32> {
    fn foo(&'static self$0) {}
}
```

Old:

```rust
struct Foo<T>(T);
impl Foo<i32> {
    fn foo(this: &Foo) {}
}
```

Fixes:

```rust
struct Foo<T>(T);
impl Foo<i32> {
    fn foo(this: &'static Self) {}
}
```
2025-07-23 13:51:28 +08:00
bors
20aa182235 Auto merge of #143897 - cjgillot:derive-walk, r=petrochenkov
Implement AST visitors using a derive macro.

AST visitors are large and error-prone beasts. This PR attempts to write them using a derive macro.

The design uses three traits: `Visitor`, `Visitable`, `Walkable`.
- `Visitor` is the trait implemented by downstream crates, it lists `visit_stuff` methods, which call `Walkable::walk_ref` by default;
- `Walkable` is derived using the macro, the generated `walk_ref` method calls `Visitable::visit` on each component;
- `Visitable` is implemented by `common_visitor_and_walkers` macro, to call the proper `Visitor::visit_stuff` method if it exists, to call `Walkable::walk_ref` if there is none.

I agree this is quite a lot of spaghetti macros. I'm open to suggestions on how to reduce the amount of boilerplate code.

If this PR is accepted, I believe the same design can be used for the HIR visitor.
2025-07-23 04:24:50 +00:00
Shoyu Vanilla (Flint)
3d34e42c82 Merge pull request #20281 from ChayimFriedman2/parse-hrtb-const
fix: Parse `for<'a> [const]`
2025-07-23 01:50:16 +00:00
Predrag Gruevski
45231fa599 [rustdoc] Display unsafe attrs with edition 2024 unsafe() wrappers. 2025-07-23 00:00:01 +00:00
León Orell Valerian Liehr
9bb9c39fa5 Don't suggest assoc ty bound on non-angle-bracketed problematic assoc ty binding 2025-07-23 01:59:25 +02:00
gewitternacht
623317eb5e add links to collections 2025-07-23 01:44:18 +02:00
binarycat
95de0aaed3 rustc_resolve: get rid of unused rustdoc::span_of_fragments_with_expansion
This function can cause false negatives if used incorrectly
(usually "do any of the doc fragments come from a macro" is
the wrong question to ask), and thus it is unused.
2025-07-22 18:36:09 -05:00
Alisa Sireneva
ed11a39643 Don't special-case llvm.* as nounwind
Certain LLVM intrinsics, such as `llvm.wasm.throw`, can unwind. Marking
them as nounwind causes us to skip cleanup of locals and optimize out
`catch_unwind` under inlining or when `llvm.wasm.throw` is used directly
by user code.

The motivation for forcibly marking llvm.* as nounwind is no longer
present: most intrinsics are linked as `extern "C"` or other
non-unwinding ABIs, so we won't codegen `invoke` for them anyway.
2025-07-23 02:17:54 +03:00
gewitternacht
cdbcd72f34 remove trailing whitespace 2025-07-23 00:41:48 +02:00
Camille GILLOT
3440bc92f9 Unquerify extern_mod_stmt_cnum. 2025-07-22 22:37:50 +00:00
binarycat
05a62c8a11 impl items are never unnamable 2025-07-22 17:11:48 -05:00
binarycat
f57283d614 rustdoc: actually never link to unnamable types 2025-07-22 17:11:48 -05:00
binarycat
94700f8f3f fix regression test 2025-07-22 17:11:48 -05:00
binarycat
4762694e4a rustdoc: never try to link to unnamable types 2025-07-22 17:11:48 -05:00
binarycat
293f95fb0c add regression test for RUST-143222 2025-07-22 17:11:48 -05:00
Jules Bertholet
acb0e71c49 Make lints work with allow_internal_unstable 2025-07-23 00:10:58 +02:00
gewitternacht
30033b45bb document assumptions about Clone and Eq traits 2025-07-22 23:16:49 +02:00
binarycat
9e75032a9d rustdoc: avoid allocating a temp String for aliases in search index 2025-07-22 14:51:38 -05:00
bors
a7a1618e6c Auto merge of #144249 - GuillaumeGomez:asm-tests, r=jieyouxu
Rename `tests/{assembly,codegen}` into `tests/{assembly,codegen}-llvm` and ignore these testsuites if configured backend doesn't match

Follow-up of https://github.com/rust-lang/rust/pull/144125.

This PR changes `compiletest` so that `asm` tests are only run if they match the current codegen backend. To better reflect it, I renamed the `tests/ui/asm` folder into `tests/ui/asm-llvm`. Like that, we can add new asm tests for other backends if we want without needing to add extra code to `compiletest`.

Next step will be to use the new code annotations added in rust-lang/rust#144125 to ignore ui tests failing in cg_gcc until it's fixed on our side.

cc `@antoyo` `@oli-obk`
r? `@Kobzol`
2025-07-22 18:39:58 +00:00
Folkert de Vries
4bf215162a Merge pull request #1880 from folkertdev/remove-lazy-static-dep
`intrinsic-test`: remove `lazy_static` dependency
2025-07-22 18:37:22 +00:00
Jakub Beránek
9a1179c4de Embed auxv files directly into the test binary 2025-07-22 20:22:16 +02:00
Jakub Beránek
81d90d8257 Improve error messages of auxv loading 2025-07-22 20:22:16 +02:00
Jakub Beránek
5e52677a82 Remove licenses from std-detect
They are subsumed by the main repo licenses.
2025-07-22 20:22:16 +02:00
Jakub Beránek
cbd9fe012a Bless bootstrap tests 2025-07-22 20:22:16 +02:00
Jakub Beránek
847f8db5ad Remove std_detect from stdarch's CI 2025-07-22 20:22:16 +02:00
Jakub Beránek
608297247a Remove std_detect from stdarch examples 2025-07-22 20:22:16 +02:00
Jakub Beránek
ffa97a647e Fix warning 2025-07-22 20:22:16 +02:00
Jakub Beránek
e07a1bbb79 Move tests around to appease tidy 2025-07-22 20:22:16 +02:00
Folkert de Vries
aaa5d91a02 remove lazy_static dependency from intrinsic-test
we use `std::sync::LazyLock` now.
2025-07-22 20:20:48 +02:00
Jakub Beránek
8dc2abb5c3 Update stdarch README 2025-07-22 20:17:49 +02:00
Jakub Beránek
ee6f2c5276 Reformat std_detect 2025-07-22 20:17:46 +02:00
Jakub Beránek
1057a2213a Allow platform-specific code in std_detect 2025-07-22 20:17:24 +02:00
Jakub Beránek
b23ab7888a Make std_detect a direct dependency of std 2025-07-22 20:17:23 +02:00
Jakub Beránek
5b2de8ab27 Move std_detect from library/stdarch to library 2025-07-22 20:17:06 +02:00
Sayantan Chakraborty
4b95bb7d67 Merge pull request #1881 from folkertdev/s390x-project-simd
work around not being able to project into SIMD values
2025-07-22 18:03:20 +00:00