Allow dropping dyn principal
Revival of #126660, which was a revival of #114679. Fixes#126313.
Allows dropping principal when coercing trait objects, e.g. `dyn Debug + Send` -> `dyn Send`.
cc `@compiler-errors` `@Jules-Bertholet`
r? `@lcnr`
Bump libc to 0.2.161
Bumps libc to the latest release version 0.2.161 which
- includes libc support for the tier 3 RTEMS target
- fixes segfaults on 32-bit FreeBSD targets
- gets musl's `posix_spawn_file_actions_addchdir_np` for some spawn opts
Various fixes for Xous
This patchset includes several fixes for Xous that have crept in over the last few months:
* The `adjust_process()` syscall was incorrect
* Warnings have started appearing in `alloc` -- adopt the same approach as wasm, until wasm figures out a workaround
* Dead code warnings have appeared in the networking code. Add `allow(dead_code)` as these structs are used as IPC values
* Add support for `args` and `env`, which have been useful for running tests
* Update `unwinding` to `0.2.3` which fixes the recent regression due to changes in `asm!()` code
Avoid superfluous UB checks in `IndexRange`
`IndexRange::len` is justified as an overall invariant, and
`take_prefix` and `take_suffix` are justified by local branch
conditions. A few more UB-checked calls remain in cases that are only
supported locally by `debug_assert!`, which won't do anything in
distributed builds, so those UB checks may still be useful.
We generally expect core's `#![rustc_preserve_ub_checks]` to optimize
away in user's release builds, but the mere presence of that extra code
can sometimes inhibit optimization, as seen in #131563.
Rollup of 7 pull requests
Successful merges:
- #129620 (Provide a more convinient way of developing rustc on NixOS)
- #131805 (rustc_llvm: Fix flattened CLI args)
- #131818 (Enable XRay instrumentation for LoongArch Linux targets)
- #131825 (SolverDelegate add assoc type for Infcx)
- #131833 (Add `must_use` to `CommandExt::exec`)
- #131835 (Do not run test where it cannot run)
- #131844 (Add mailmap entry for kobzol)
r? `@ghost`
`@rustbot` modify labels: rollup
Add `must_use` to `CommandExt::exec`
[CommandExt::exec](https://fburl.com/0qhpo7nu) returns a `std::io::Error` in the case exec fails, but its not currently marked as `must_use` making it easy to accidentally ignore it.
This PR adds the `must_use` attributed here as i think it fits the definition in the guide of [When to add #[must_use]](https://std-dev-guide.rust-lang.org/policy/must-use.html#when-to-add-must_use)
optimize str.replace
Adds a fast path for str.replace for the ascii to ascii case. This allows for autovectorizing the code. Also should this instead be done with specialization? This way we could remove one branch. I think it is the kind of branch that is easy to predict though.
Benchmark for the fast path (replace all "a" with "b" in the rust wikipedia article, using criterion) :
| N | Speedup | Time New (ns) | Time Old (ns) |
|----------|---------|---------------|---------------|
| 2 | 2.03 | 13.567 | 27.576 |
| 8 | 1.73 | 17.478 | 30.259 |
| 11 | 2.46 | 18.296 | 45.055 |
| 16 | 2.71 | 17.181 | 46.526 |
| 37 | 4.43 | 18.526 | 81.997 |
| 64 | 8.54 | 18.670 | 159.470 |
| 200 | 9.82 | 29.634 | 291.010 |
| 2000 | 24.34 | 81.114 | 1974.300 |
| 20000 | 30.61 | 598.520 | 18318.000 |
| 1000000 | 29.31 | 33458.000 | 980540.000 |
Changelog for Clippy 1.82 ✈️
```
Roses are red,
Violets are blue,
EuroRust in Austria,
RustConf in Canada.
```
---
### The cat of this release is *Racka*:
<img height=500 src="https://github.com/user-attachments/assets/e5e3cc95-6fc3-4214-aab0-4f26e0967ae5" alt="The cats of this Clippy release" />
Cats for the next release can be nominated in the comments :D
---
changelog: none
Rollup of 7 pull requests
Successful merges:
- #128391 (Change orphan hint from "only" to "any uncovered type inside...")
- #131583 (Setting up indirect access to external data for loongarch64-linux-{musl,ohos})
- #131595 (rustdoc-JSON: Rename "object safe" to "dyn compatible")
- #131748 (cleanup canonical queries)
- #131798 (llvm: Tolerate propagated range metadata)
- #131815 (compiler: use `is_none_or` where it is clearly better)
- #131822 (extract `expr_assign_expected_bool_error`)
r? `@ghost`
`@rustbot` modify labels: rollup
compiler: use `is_none_or` where it is clearly better
heuristic was: if it easily allows removing bangs entirely? worth it. if it requires more effort or just moves the bang? not.
llvm: Tolerate propagated range metadata
llvm/llvm-project#91101 propagates range information across inlining, resulting in more metadata in this test. Tolerate the range metadata if it appears.
``@rustbot:`` label +llvm-main
r? ``@durin42``
Please wait a moment before approving, putting the llvm-main tag on it to make sure it fixes the integration test.
cleanup canonical queries
best reviewed commit by commit. adding `CanonicalQueryInput` to stop returning `defining_opaque_types` in query responses is the most involved change here.
r? ``@compiler-errors``
rustdoc-JSON: Rename "object safe" to "dyn compatible"
~~Blocked: Sits atop #131594. Only the last commit is relevant.~~ (rebased)
Part of #130852.
r? aDotInTheVoid or rustdoc
Setting up indirect access to external data for loongarch64-linux-{musl,ohos}
In issue #118053, the `loongarch64-unknown-linux-gnu` target needs indirection to access external data, and so do the `loongarch64-unknown-linux-musl` and `loongarch64-unknown-linux-ohos` targets.