304366 Commits

Author SHA1 Message Date
Jake Goulding
c574c91e57 Demote x86_64-apple-darwin to Tier 2 with host tools
Switch to only using aarch64 runners (implying we are now
cross-compiling) and stop running tests. In the future, we could
enable (some?) tests via Rosetta 2.
2025-08-15 12:00:13 -04:00
Esteban Küber
8baab4cdf7 Detect missing derive on unresolved attribute even when not imported
```
error: cannot find attribute `sede` in this scope
  --> $DIR/missing-derive-3.rs:20:7
   |
LL |     #[sede(untagged)]
   |       ^^^^
   |
help: the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute
   |
LL |     #[serde(untagged)]
   |         +

error: cannot find attribute `serde` in this scope
  --> $DIR/missing-derive-3.rs:14:7
   |
LL |     #[serde(untagged)]
   |       ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> $DIR/missing-derive-3.rs:4:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Deserialize` and `Serialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Deserialize, Serialize)]
LL | enum B {
   |
```
2025-08-15 15:56:45 +00:00
bors
8b1889cc22 Auto merge of #145450 - Kobzol:rollup-cqclix0, r=Kobzol
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#144210 (std: thread: Return error if setting thread stack size fails)
 - rust-lang/rust#145310 (Reduce usage of `compiler_for` in bootstrap)
 - rust-lang/rust#145311 (ci: clean windows disk space in background)
 - rust-lang/rust#145340 (Split codegen backend check step into two and don't run it with `x check compiler`)
 - rust-lang/rust#145408 (Deduplicate -L search paths)
 - rust-lang/rust#145412 (Windows: Replace `GetThreadId`+`GetCurrentThread` with `GetCurrentThreadId`)
 - rust-lang/rust#145413 (bootstrap: Reduce dependencies)
 - rust-lang/rust#145426 (Fix typos in bootstrap.example.toml)
 - rust-lang/rust#145430 (Fix wrong spans with external macros in the `dropping_copy_types` lint)
 - rust-lang/rust#145431 (Enhance UI test output handling for runtime errors)
 - rust-lang/rust#145448 (Autolabel `src/tools/{rustfmt,rust-analyzer}` changes with `T-{rustfmt,rust-analyzer}`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-15 15:44:03 +00:00
Jakub Beránek
24f5cc41c8
Do not copy files in copy_src_dirs in dry run 2025-08-15 16:58:52 +02:00
Jakub Beránek
e9ce9ff498
Fix tracing debug representation of steps without arguments in bootstrap 2025-08-15 16:54:13 +02:00
Jakub Beránek
33218a25c8
Remove duplicated tracing span in bootstrap 2025-08-15 16:30:05 +02:00
Jakub Beránek
ef3bb6fb0b
Do not strip binaries in bootstrap everytime if they are unchanged 2025-08-15 16:26:07 +02:00
Waffle Lapkin
1d00627966
add static glibc to the nix dev shell
this fixes `tests/ui/process/nofile-limit.rs` which fails to link on
nixos for me without this change
2025-08-15 16:16:25 +02:00
Jakub Beránek
9bf76aba76
Rollup merge of #145448 - jieyouxu:rustfmt-labels, r=fmease
Autolabel `src/tools/{rustfmt,rust-analyzer}` changes with `T-{rustfmt,rust-analyzer}`

Make e.g. rust-lang/rust#144323 more obvious who should be reviewing it and easier to filter.
2025-08-15 16:04:02 +02:00
Jakub Beránek
b979a31d78
Rollup merge of #145431 - AMS21:fix_141531, r=jieyouxu
Enhance UI test output handling for runtime errors

When a UI test runs a compiled binary and an error/forbid pattern check fails, the failure message previously only showed compiler output, hiding the executed programs stdout/stderr. This makes it harder to see near-miss or unexpected runtime lines.

Fixed rust-lang/rust#141531
Supersedes rust-lang/rust#141977
2025-08-15 16:04:01 +02:00
Jakub Beránek
c97a9c82b2
Rollup merge of #145430 - Urgau:drop_forget_useless-145427, r=lqd
Fix wrong spans with external macros in the `dropping_copy_types` lint

This PR fixes some wrong spans manipulations when external macros are involved.

Specifically we didn't make sure the spans had the same context, which kind-of make our spans manipulations go wrong and produce weird spans. We fix that by making sure they have the same context.

Fixes https://github.com/rust-lang/rust/issues/145427
2025-08-15 16:04:01 +02:00
Jakub Beránek
501837fa88
Rollup merge of #145426 - AMS21:fix_typos_bootstrap_example, r=lqd
Fix typos in bootstrap.example.toml

Founds these small typos while looking around.

`equivelent` -> `equivalent`
`recommeded` -> `recommended`

cheers :)
2025-08-15 16:04:00 +02:00
Jakub Beránek
82c6ad3eda
Rollup merge of #145413 - joshtriplett:bootstrap-reduce-deps, r=clubby789
bootstrap: Reduce dependencies

Eliminate the `fd-lock` dependency by using the new native locking in std.

Eliminate the `xattr` dependency by turning off a feature flag in `tar`, since
the tarballs that we extract with bootstrap don't need it.
2025-08-15 16:03:59 +02:00
Jakub Beránek
7c93af02e3
Rollup merge of #145412 - tgross35:win-tid, r=ChrisDenton
Windows: Replace `GetThreadId`+`GetCurrentThread` with `GetCurrentThreadId`

Reference: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentthreadid
2025-08-15 16:03:58 +02:00
Jakub Beránek
30c967ddba
Rollup merge of #145408 - Kobzol:deduplicate-search-paths, r=petrochenkov
Deduplicate -L search paths

For each -L passed to the compiler, we eagerly scan the whole directory. If it has a lot of files, that results in a lot of allocations. So it's needless to do this if some -L paths are actually duplicated (which can happen e.g. in the situation in the linked issue).

This PR both deduplicates the args, and also teaches rustdoc not to pass duplicated args to merged doctests.

Fixes: https://github.com/rust-lang/rust/issues/145375
2025-08-15 16:03:58 +02:00
Jakub Beránek
0734cbda19
Rollup merge of #145340 - Kobzol:bootstrap-codegen-backend-check-split, r=jieyouxu
Split codegen backend check step into two and don't run it with `x check compiler`

This reduces the amount of work that is done during `x check compiler`. We still check both backends during `x check` by defaut, even if they are not in `rust.codegen-backends`, as just checking them shouldn't require expensive preparations, like building GCC.

r? `@jieyouxu`
2025-08-15 16:03:57 +02:00
Jakub Beránek
b474f89d5e
Rollup merge of #145311 - marcoieni:clean-disk-in-background-windows, r=Kobzol
ci: clean windows disk space in background
2025-08-15 16:03:56 +02:00
Jakub Beránek
87d677b7d0
Rollup merge of #145310 - Kobzol:compiler-for-revamp, r=jieyouxu
Reduce usage of `compiler_for` in bootstrap

While working on refactoring/fixing `dist` steps, I realized that `build.full-bootstrap` does much more than it should, and that it its documentation is wrong. It seems that the main purpose of this option should be to enable/disable stdlib/compiler uplifting (https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Purpose.20of.20.60build.2Efull-bootstrap.60/with/533985624), but currently it also affects staging, or more precisely which compiler will be used to build selected steps, because this option is used in the cursed `compiler_for` function.

I would like to change the option it so that it *only* affects uplifting, and doesn't affect stage selection, which I (partially) did in this PR. I removed the usage of `compiler_for` from the `Std` and `Rustc` steps, and explicitly implemented uplifting, without going through `compiler_for`.

The only remaining usages of `compiler_for` are in dist steps (which I'm currently refactoring, will send a PR later) and test steps (which I will take a look at after dist). After that we can finally remove the function.

I tried to document the case when uplifting was happening during cross-compilation, which was very implicit before. I also did a slight change in the uplifting logic for rustc when cross-compiling. Before, we would attempt to uplift a stage1 rustc, but that is not really a thing when cross-compiling.

r? `@jieyouxu`
2025-08-15 16:03:56 +02:00
Jakub Beránek
a676c4891e
Rollup merge of #144210 - Gelbpunkt:thread-stack-size-musl, r=jhpratt
std: thread: Return error if setting thread stack size fails

Currently, when setting the thread stack size fails, it would be rounded up to the nearest multiple of the page size and the code asserts that the next call to `pthread_attr_setstacksize` succeeds.

This may be true for glibc, but it isn't true for musl, which not only enforces a minimum stack size, but also a maximum stack size of `usize::MAX / 4 - PTHREAD_STACK_MIN` [1], triggering the assert rather than erroring gracefully.

There isn't any way to handle this properly other than bailing out and letting the user know it didn't succeed.

[1]: https://git.musl-libc.org/cgit/musl/tree/src/thread/pthread_attr_setstacksize.c#n5
2025-08-15 16:03:55 +02:00
Jieyou Xu
26817eec05
Autolabel src/tools/{rustfmt,rust-analyzer} changes with T-{rustfmt,rust-analyzer} 2025-08-15 21:34:58 +08:00
Jason Newcomb
9563a5ce46
{borrow,ptr}_as_ptr: don't lint inside proc-macros (#15473)
this could arguably be 2 separate PRs, but both of these were brought up
in the same issue, so..

fixes https://github.com/rust-lang/rust-clippy/issues/15398

- [x] I'm a bit doubtful about the last commit -- see the message for my
reasoning and do let me know whether it's right.

changelog: [`borrow_as_ptr`]: don't lint inside proc-macros
changelog: [`ptr_as_ptr`]: don't lint inside proc-macros
2025-08-15 13:34:52 +00:00
StackOverflowExcept1on
f36ab498ce
fix(tests/rmake/wasm-unexpected-features): change features from WASM1 to MVP 2025-08-15 15:48:46 +03:00
Jake Goulding
36a38206db Use aarch64-apple-darwin as the fallback doc source for -apple-
We are moving away from `x86_64-apple-darwin`, so soon these docs
won't be available.
2025-08-15 08:38:14 -04:00
bors
c018ae5389 Auto merge of #144991 - lcnr:ignore-usages-from-ignored-candidates, r=BoxyUwU
ignore head usages from ignored candidates

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/210. The test now takes 0.8s to compile, which seems good enough to me. We are actually still walking the entire graph here, we're just avoiding unnecessary reruns.

The basic idea is that if we've only accessed a cycle head inside of a candidate which didn't impact the final result of our goal, we don't need to rerun that cycle head even if is the used provisional result differs from the final result.

We also use this information when rebasing goals over their cycle heads. If a goal doesn't actually depend on the result of that cycle head, rebasing always succeeds. However, we still need to make sure we track the fact that we relied on the cycle head at all to avoid query instability.

It is implemented by tracking the number of `HeadUsages` for every head while evaluating goals. We then also track the head usages while evaluating a single candidate, which the search graph returns as `CandidateHeadUsages`. If there is now an always applicable candidate  candidate we know that all other candidates with that source did not matter. We then call `fn ignore_candidate_head_usages` to remove the usages while evaluating this single candidate from the total. If the final `HeadUsages` end up empty, we know that the result of this cycle head did not matter when evaluating its nested goals.
2025-08-15 12:35:09 +00:00
Ada Alakbarova
9570ed8363
ptr_as_ptr: don't allow in proc-macros
notice that this stops `inline!` from working as well
2025-08-15 14:04:37 +02:00
Jakub Beránek
6f1c998ca9
Sort mono items by symbol name 2025-08-15 14:04:32 +02:00
AMS21
dbd5addf88
Enhance UI test output handling for runtime errors
When a UI test runs a compiled binary and an error/forbid pattern
check fails, the failure message previously only showed compiler output,
hiding the executed programs stdout/stderr. This makes it harder to
see near-miss or unexpected runtime lines.
2025-08-15 13:33:08 +02:00
Zalathar
9e7d066928 Simplify the args_cstr_buff assertion 2025-08-15 20:24:13 +10:00
Zalathar
61932e1222 Avoid an unnecessary intermediate &mut reference
The `NonNull::as_mut` method returns a mut *reference*, rather than the mut
*pointer* that is intended here.
2025-08-15 20:24:13 +10:00
Zalathar
44f5ec7d56 Avoid an explicit cast from *const c_uchar to *const c_char
As noted in the `ffi` module docs, passing pointer/length byte strings from
Rust to C++ is easier if we declare them as `*const c_uchar` on the Rust side,
but `const char *` (possibly signed) on the C++ side. This is allowed because
both pointer types are ABI-compatible, regardless of char signedness.
2025-08-15 20:24:13 +10:00
Zalathar
8d0a04966c Declare module rustc_codegen_llvm::back in the normal way
Declaring these submodules directly in `lib.rs` was needlessly confusing.
2025-08-15 20:24:13 +10:00
Jakub Beránek
1f3a7471bf
Implement #[derive(From)] 2025-08-15 12:07:15 +02:00
Jakub Beránek
c0839ea7d2
Add feature gate test 2025-08-15 12:06:20 +02:00
Jakub Beránek
e935a155c2
Create unstable From builtin macro and register it 2025-08-15 12:06:20 +02:00
Jakub Beránek
f39085bb37
Add derive_from unstable feature 2025-08-15 12:06:20 +02:00
bjorn3
f94a0d0ca4 Remove unused feature gate 2025-08-15 10:04:04 +00:00
bjorn3
460519a7f5 Merge link_name and export_name 2025-08-15 10:04:04 +00:00
Urgau
ae4eeb9299 Fix wrong spans with external macros in the dropping_copy_types lint 2025-08-15 11:59:23 +02:00
Zalathar
e193b5342b Use LLVMGetTypeKind 2025-08-15 19:35:35 +10:00
bjorn3
f3ef465ffb Combining no_mangle and rustc_std_internal_symbol is not allowed 2025-08-15 09:27:29 +00:00
bjorn3
4d62bf1634 All weak lang items have an explicit link name and vice versa 2025-08-15 09:21:18 +00:00
Sasha Pourcelot
51bccdd1ab Port #[custom_mir(..)] to the new attribute system 2025-08-15 11:19:29 +02:00
bors
ba412a6e70 Auto merge of #145423 - Zalathar:rollup-9jtefpl, r=Zalathar
Rollup of 21 pull requests

Successful merges:

 - rust-lang/rust#118087 (Add Ref/RefMut try_map method)
 - rust-lang/rust#122661 (Change the desugaring of `assert!` for better error output)
 - rust-lang/rust#142640 (Implement autodiff using intrinsics)
 - rust-lang/rust#143075 (compiler: Allow `extern "interrupt" fn() -> !`)
 - rust-lang/rust#144865 (Fix tail calls to `#[track_caller]` functions)
 - rust-lang/rust#144944 (E0793: Clarify that it applies to unions as well)
 - rust-lang/rust#144947 (Fix description of unsigned `checked_exact_div`)
 - rust-lang/rust#145004 (Couple of minor cleanups)
 - rust-lang/rust#145005 (strip prefix of temporary file names when it exceeds filesystem name length limit)
 - rust-lang/rust#145012 (Tail call diagnostics to include lifetime info)
 - rust-lang/rust#145065 (resolve: Introduce `RibKind::Block`)
 - rust-lang/rust#145120 (llvm: Accept new LLVM lifetime format)
 - rust-lang/rust#145189 (Weekly `cargo update`)
 - rust-lang/rust#145235 (Minor `[const]` tweaks)
 - rust-lang/rust#145275 (fix(compiler/rustc_codegen_llvm): apply `target-cpu` attribute)
 - rust-lang/rust#145322 (Resolve the prelude import in `build_reduced_graph`)
 - rust-lang/rust#145331 (Make std use the edition 2024 prelude)
 - rust-lang/rust#145369 (Do not ICE on private type in field of unresolved struct)
 - rust-lang/rust#145378 (Add `FnContext` in parser for diagnostic)
 - rust-lang/rust#145389 ([rustdoc] Revert "rustdoc search: prefer stable items in search results")
 - rust-lang/rust#145392 (coverage: Remove intermediate data structures from mapping creation)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-15 09:13:10 +00:00
AMS21
cda2114c65
Fix typos in bootstrap.example.toml
equivelent -> equivalent
recommeded -> recommended
2025-08-15 09:57:24 +02:00
Shoyu Vanilla
2218ff1940 fix: Reject async assoc fns of const traits/impls in ast_passes 2025-08-15 16:31:10 +09:00
Jakub Beránek
f2c2d3ebc3
Clarify that build.full-bootstrap is only used to affect uplifting, not stage selection 2025-08-15 08:23:57 +02:00
Jakub Beránek
36dfed6435
Remove usage of compiler_for from the compile::Rustc step 2025-08-15 08:23:57 +02:00
Jakub Beránek
d8a51f58b3
Remove usage of compiler_for from the compile::Std step 2025-08-15 08:21:15 +02:00
Jakub Beránek
8a7be4ab5e
Rename compiler to build_compiler in the compile::Std step 2025-08-15 08:21:14 +02:00
Jakub Beránek
2a2903c49e
Split codegen backend check step into two and don't run it with x check compiler 2025-08-15 08:19:46 +02:00