35709 Commits

Author SHA1 Message Date
bors
8f0faf94fb Auto merge of #144225 - purplesyringa:unwinding-intrinsics, r=nikic
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.

Closes rust-lang/rust#132416.

`@rustbot` label +T-compiler +A-panic
2025-07-27 23:05:48 +00:00
Lukas Wirth
db02cdc7fc
Merge pull request #20319 from Veykril/push-znwukpmpsqxt
fix: Consider all produced artifacts for proc-macro dylib search
2025-07-28
2025-07-27 21:33:02 +00:00
Lukas Wirth
6b09fbf881 fix: Consider all produced artifacts for proc-macro dylib search 2025-07-27 23:21:42 +02:00
Lukas Wirth
e90966801e
Merge pull request #20318 from Veykril/push-vpqsrylmkqqm
fix: Ignore `Destruct` bounds again
2025-07-27 20:50:23 +00:00
Lukas Wirth
afee0710e1 Ignore Destruct bounds again 2025-07-27 22:39:01 +02:00
Lukas Wirth
b398bc6af7 Cleanup unstable flags handling 2025-07-27 22:39:01 +02:00
Laurențiu Nicola
098fdb4ff1
Merge pull request #20317 from Veykril/push-koossvzyyvmm
fix: Fix incorrect build script version check
2025-07-27 19:34:24 +00:00
Lukas Wirth
dd5129b832 fix: Fix incorrect build script version check 2025-07-27 21:22:50 +02:00
bors
76f8c7f459 Auto merge of #144434 - nnethercote:preintern-ty-bounds, r=compiler-errors
Preintern some `TyKind::Bound` values

The new trait solver produces a lot of these.

r? `@compiler-errors`
2025-07-27 18:58:43 +00:00
Lukas Wirth
68810295f2
Merge pull request #20315 from Veykril/push-pvmslwwouzzx
internal: Fix lockfile temp dir usage and use it for build scripts as well
2025-07-27 18:39:39 +00:00
Lukas Wirth
df85aac1d4 Copy lockfile when building build scripts 2025-07-27 20:28:22 +02:00
Lukas Wirth
7950da3940 internal: Better type proc macro dylib build data state 2025-07-27 19:37:16 +02:00
bors
3ba4dcc267 Auto merge of #144425 - nnethercote:avoid-new_adt-new_fn_def, r=compiler-errors
Avoid unnecessary `new_adt`/`new_fn_def` calls.

They can be skipped if there are no arguments, avoiding the "relate" operation work and also the subsequent interning.

r? `@ghost`
2025-07-27 15:56:47 +00:00
Shoyu Vanilla (Flint)
971c393ab3
Merge pull request #20305 from Hmikihiro/Migrate_part_of_utils
Migrate part of utils.rs to use SyntaxEditor
2025-07-27 14:43:01 +00:00
Hayashi Mikihiro
475ebb8fef Migrate convert_tuple_struct_to_named_struct' assist to use SyntaxEditor'
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-27 22:56:24 +09:00
Hayashi Mikihiro
d02bf21c47 migrate fn edit_struct_def in convert_tuple_struct_to_named_struct to SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-27 22:56:24 +09:00
Hayashi Mikihiro
6e2306faaf remove ted from convert_tuple_struct_to_named_struct
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-27 22:56:24 +09:00
Hmikihiro
96f619d0d0 Migrate inline_type_alias assist to use SyntaxEditor 2025-07-27 22:49:56 +09:00
Hmikihiro
feaf647b06 refactor: conpare text of name_ref instead of syntax name_ref 2025-07-27 22:49:56 +09:00
Lukas Wirth
2a577eb2f5 Unherit server extra env for runnables extra env 2025-07-27 14:09:21 +02:00
Lukas Wirth
92d56156a4 fix: Fix runnables extra env not substituting env vars 2025-07-27 14:07:10 +02:00
Lukas Wirth
b77072075c
Merge pull request #20290 from ShoyuVanilla/tmp-lockfiles
Use `TempDir` for copied lockfiles
2025-07-27 11:36:35 +00:00
bors
29c5fb8410 Auto merge of #144347 - scottmcm:ssa-enums-v0, r=WaffleLapkin
No longer need `alloca`s 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.

While doing so, rewrite `LocalAnalyzer::process_place` to be non-recursive, solving a 6+ year old FIXME.

r? codegen
2025-07-27 06:37:55 +00:00
Laurențiu Nicola
7a621817af
Merge pull request #20302 from Young-Flash/fix_20240
fix fold doc comment for multiline param list fn
2025-07-27 06:01:44 +00:00
Young-Flash
bb163570f2 minor: fix typo 2025-07-27 10:54:43 +08:00
bors
c1c3057e27 Auto merge of #143860 - scottmcm:transmute-always-rvalue, r=WaffleLapkin
Let `codegen_transmute_operand` just handle everything

When combined with rust-lang/rust#143720, this means `rvalue_creates_operand` can just return `true` for *every* `Rvalue`.  (A future PR could consider removing it, though just letting it optimize out is fine for now.)

It's nicer anyway, IMHO, because it avoids needing the layout checks to be consistent in the two places, and thus is an overall reduction in code.  Plus it's a more helpful building block when used in other places this way.

(TBH, it probably would have been better to have it this way the whole time, but I clearly didn't understand `rvalue_creates_operand` when I originally wrote rust-lang/rust#109843.)
2025-07-26 22:45:18 +00:00
bors
d1f780b759 Auto merge of #143500 - compiler-errors:characterize-less, r=lcnr
Skip walking into param-env component if it has no placeholder/re-var

Although it only provides a minor perf improvement, it seems like it could matter in more pathological cases.
2025-07-26 16:57:45 +00:00
Laurențiu Nicola
ea413f67a8
Merge pull request #20307 from Hmikihiro/migrate_extract_expression_from_format_string
Migrate `extract_expressions_from_format_string` assist to use `SyntaxEditor`
2025-07-26 14:34:56 +00:00
Laurențiu Nicola
b0ae0abfc0
Merge pull request #20306 from Hmikihiro/migrate_convert_to_guarded_return
Migrate `Convert_to_guarded_return` assist to use SyntaxEditor
2025-07-26 13:58:10 +00:00
Hayashi Mikihiro
c9abba3c7a Migrate extract_expressions_from_format_string assist to use SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-26 18:23:22 +09:00
Hayashi Mikihiro
92922f5e56 Migrate Convert_to_guarded_return to use SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-26 18:17:09 +09:00
Hayashi Mikihiro
2c16eb8fa0 Migrate part of utils.rs to use SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-26 17:07:41 +09:00
Hayashi Mikihiro
46e86c6aa2 Migrate PathTransform to SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-26 13:26:39 +09:00
Hayashi Mikihiro
4866c4c2eb add Debug on AstSubst PathTransform.rs
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-26 13:26:11 +09:00
Young-Flash
a56035dd4e test: add test case for fold doc comment for multiline param list fn 2025-07-26 11:59:50 +08:00
Young-Flash
a0c7a4ab83 fix fold doc comment for multiline param list fn 2025-07-26 11:57:48 +08:00
bors
1bbcf9d107 Auto merge of #139597 - Kobzol:lint-skip, r=BoxyUwU
Do not run per-module late lints if they can be all skipped

We run ~70 late lints for all dependencies even if they use `--cap-lints=allow`, which seems wasteful. It looks like these lints are super fast (unlike early lints), but still.

r? `@ghost`
2025-07-26 02:31:12 +00:00
bors
13e8568c78 Auto merge of #144338 - weihanglo:update-cargo, r=weihanglo
Update cargo

8 commits in 6833aa715d724437dc1247d0166afe314ab6854e..9b296973b425ffb159e12cf3cd56580fd5c85382
2025-07-13 02:25:52 +0000 to 2025-07-25 17:10:08 +0000
- Allow using Cargo-as-a-library with gix's reqwest backend (rust-lang/cargo#15653)
- Make timings graphs scalable to user's window (rust-lang/cargo#15766)
- refactor: rename arg `mode` to `intent` (rust-lang/cargo#15774)
- fix: `no-proc-macro` is overridden by subsequent edges (rust-lang/cargo#15764)
- Use `gix` for `cargo package` (rust-lang/cargo#15534)
- cargo-credential-libsecret: give FFI correctly-sized object (rust-lang/cargo#15767)
- Remove unnecessary target-c-int-width from target specs (rust-lang/cargo#15759)
- Expose artifact dependency getters in cargo-as-a-library (rust-lang/cargo#15753)
2025-07-25 23:29:17 +00:00
bors
62ca132906 Auto merge of #144449 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2025-07-25 19:19:45 +00:00
Shoyu Vanilla (Flint)
51e77c9d7b
Merge pull request #20293 from Hmikihiro/migrate_replace_derive_with_manual_impl
Migrate `replace derive with manual impl` and `add_missing_impl_members` to use `SyntaxEditor`
2025-07-25 15:40:26 +00:00
Hayashi Mikihiro
82dfdacb78 Modify around add_trait_assoc_items_to_impl to migrate add_missing_impl_members
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-26 00:22:29 +09:00
Hmikihiro
827e3f7c17 migrate_replace_derive_with_manual_impl 2025-07-25 19:50:44 +09:00
Hmikihiro
4a0527f78c split ted from gen_trait_fn_body 2025-07-25 19:50:44 +09:00
bors
c2c1ab178b Auto merge of #144440 - matthiaskrgr:rollup-peb88gb, r=matthiaskrgr
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#142569 (Suggest clone in user-write-code instead of inside macro)
 - rust-lang/rust#143401 (tests: Don't check for self-printed output in std-backtrace.rs test)
 - rust-lang/rust#143424 (clippy fix: rely on autoderef)
 - rust-lang/rust#143970 (Update core::mem::copy documentation)
 - rust-lang/rust#143979 (Test fixes for Arm64EC Windows)
 - rust-lang/rust#144200 (Tweak output for non-`Clone` values moved into closures)
 - rust-lang/rust#144209 (Don't emit two `assume`s in transmutes when one is a subset of the other)
 - rust-lang/rust#144314 (Hint that choose_pivot returns index in bounds)
 - rust-lang/rust#144340 (UI test suite clarity changes: Rename `tests/ui/SUMMARY.md` and update rustc dev guide on `error-pattern`)
 - rust-lang/rust#144368 (resolve: Remove `Scope::CrateRoot`)
 - rust-lang/rust#144390 (Remove dead code and extend test coverage and diagnostics around it)
 - rust-lang/rust#144392 (rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-25 10:40:01 +00:00
Matthias Krüger
9813f19c79
Rollup merge of #144392 - makai410:rm-mov, r=scottmcm
rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine`

Part of rust-lang/rust#119174 .
I think we should be good now to sync this change in rustc_public.
2025-07-25 11:16:39 +02:00
Matthias Krüger
d64e48bcf0
Rollup merge of #144390 - oli-obk:arbitrary-enum-discrs, r=SparrowLii
Remove dead code and extend test coverage and diagnostics around it

I was staring a bit at the `dont_niche_optimize_enum` variable and figured out that part of it is dead code (at least today it is). I changed the diagnostic and test around the code that makes that part dead code, so everything that makes removing that code sound is visible in this PR
2025-07-25 11:16:39 +02:00
Matthias Krüger
7c4b2b92c2
Rollup merge of #144200 - estebank:dont-point-at-closure, r=lcnr
Tweak output for non-`Clone` values moved into closures

When we encounter a non-`Clone` value being moved into a closure, try to find the corresponding type of the binding being moved, if it is a `let`-binding or a function parameter. If any of those cases, we point at them with the note explaining that the type is not `Copy`, instead of giving that label to the place where it is captured. When it is a `let`-binding with no explicit type, we point at the initializer (if it fits in a single line).

```
error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure
  --> f111.rs:14:25
   |
13 | fn do_stuff(foo: Option<Foo>) {
   |             ---  ----------- move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait
   |             |
   |             captured outer variable
14 |     require_fn_trait(|| async {
   |                      -- ^^^^^ `foo` is moved here
   |                      |
   |                      captured by this `Fn` closure
15 |         if foo.map_or(false, |f| f.foo()) {
   |            --- variable moved due to use in coroutine
```

instead of

```
error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure
  --> f111.rs:14:25
   |
13 | fn do_stuff(foo: Option<Foo>) {
   |             --- captured outer variable
14 |     require_fn_trait(|| async {
   |                      -- ^^^^^ `foo` is moved here
   |                      |
   |                      captured by this `Fn` closure
15 |         if foo.map_or(false, |f| f.foo()) {
   |            ---
   |            |
   |            variable moved due to use in coroutine
   |            move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait
```
2025-07-25 11:16:36 +02:00
Matthias Krüger
ba2c337025
Rollup merge of #143979 - dpaoliello:arm64ectest, r=petrochenkov
Test fixes for Arm64EC Windows

* `tests/ui/cfg/conditional-compile-arch.rs` needs an Arm64EC case.
* `tests/ui/runtime/backtrace-debuginfo.rs` should skip Arm64EC as it suffers from the same truncated backtraces as Arm64 Windows.
* `tests/ui/linkage-attr/incompatible-flavor.rs` is a general issue: it assumes that the Rust compiler is always built with the x86 target enabled in the backend, but I only enabled AArch64 when building locally to speed up the LLVM compilation.
2025-07-25 11:16:35 +02:00
Matthias Krüger
89a1b7dbb7
Rollup merge of #143970 - SunkenPotato:update_mem_copy_docs, r=scottmcm
Update core::mem::copy documentation

Update the documentation of `core::mem::copy` to include a `const` on the definition of the function.
2025-07-25 11:16:34 +02:00
Matthias Krüger
f3d4f5f18f
Rollup merge of #143424 - hkBst:auto-deref, r=jhpratt
clippy fix: rely on autoderef

Changes instances of `&**self` to `self`.
2025-07-25 11:16:34 +02:00