Commit Graph

336174 Commits

Author SHA1 Message Date
Guillaume Gomez
d7bd2df6bb Add code comment explaining why we need this binutils version 2026-08-16 12:20:03 +02:00
Guillaume Gomez
942fe31efe Fix tidy error 2026-08-14 21:34:37 +02:00
Guillaume Gomez
80cc60a7ea Correctly test the custom GCC built in CI 2026-08-14 21:26:24 +02:00
Guillaume Gomez
bcc35a8e30 More settings targetting binutils 2026-08-14 14:22:38 +02:00
Guillaume Gomez
88cfd2278a Use --with-as and --with-ld options for gcc configure 2026-08-14 02:40:04 +02:00
Guillaume Gomez
4c097cfeda Use --prefix to generate binaries in the right location 2026-08-13 21:56:22 +02:00
Guillaume Gomez
487e0e0b00 Display generated asm in case it failed 2026-08-13 17:47:16 +02:00
Guillaume Gomez
748a319ee1 Add extra checks to ensure GCC and binutils have needed support for the retain attribute 2026-08-13 15:09:36 +02:00
Guillaume Gomez
377ef9f028 Build newer binutils before building gcc 2026-08-12 23:52:29 +02:00
bors
a04c7a037d Auto merge of #160899 - JonathanBrouwer:rollup-Rrm4Q6k, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#156338 (Implement derives for Reborrow and CoerceShared)
 - rust-lang/rust#158083 (Fix perf regression in `Read::read_to_end` on short reads due to not checking if the cursor has initialized bytes)
 - rust-lang/rust#160829 (bootstrap: Make `main.rs` a stub that calls into the library crate)
 - rust-lang/rust#159839 (point at closure return expression in non-`FnOnce` E0271 errors)
 - rust-lang/rust#160775 (interpret: treat pattern and unsafe-binder as ABI-transparent)
2026-08-11 10:38:17 +00:00
Jonathan Brouwer
fca480be1f Rollup merge of #160775 - RalfJung:pattern-unsafe-transparent, r=oli-obk
interpret: treat pattern and unsafe-binder as ABI-transparent

This was suggested by @Jules-Bertholet in https://github.com/rust-lang/rust/pull/160658. I didn't follow all the discussions for those types. Making them transparent makes sense to me though we should make sure this is explicitly discussed as a stable guarantee when it comes to stabilizing those types.

Tracking issues: https://github.com/rust-lang/rust/issues/123646, https://github.com/rust-lang/rust/issues/130516.

r? @oli-obk
2026-08-11 11:14:55 +02:00
Jonathan Brouwer
46541dc18b Rollup merge of #159839 - Albab-Hasan:e0271-point-closure-return-span, r=oli-obk
point at closure return expression in non-`FnOnce` E0271 errors

when a closure literal is passed as a function argument and E0271 fires for a projection that isnt `FnOnceOutput`. the error now points at the closures return expression and labels the closure declaration with "this closure". mirroring the existing FnOnce handling in `maybe_detailed_projection_msg`. which cant recover the closure from `self_ty` alone.

fixes https://github.com/rust-lang/rust/issues/42390

r? @estebank
2026-08-11 11:14:54 +02:00
Jonathan Brouwer
6a1d74fe6a Rollup merge of #160829 - Zalathar:bootstrap-main, r=clubby789
bootstrap: Make `main.rs` a stub that calls into the library crate

As with some other bootstrap tools (e.g. compiletest), bootstrap itself is built as a small binary crate (executable) that links to a larger library crate.

If there is non-trivial code in `main.rs`, then any items it touches need to be publicly exported from the library crate. Those public exports make it harder to identify unused code within bootstrap.

As far as I can tell, there is no compelling rule or principle that determines whether code should be in the entry point or in the library crate, other than historical inertia.

This PR therefore takes all of the code from `main.rs`, and moves it into a new file `cli_main.rs` within the bootstrap library crate. That avoids the need for any public exports other than `cli_main::main` itself.

There should be no change to bootstrap behaviour.

---

This change makes it possible to change all of bootstrap's `pub` items to `pub(crate)`. That migration is left to a future PR, as it involves a fair bit of churn, and requires decisions on how to deal with pub items that are currently unused.

Prior art:
- https://github.com/rust-lang/rust/pull/147506
2026-08-11 11:14:53 +02:00
Jonathan Brouwer
50e8d7e09e Rollup merge of #158083 - asder8215:default_read_to_end_mark_init, r=Darksonn
Fix perf regression in `Read::read_to_end` on short reads due to not checking if the cursor has initialized bytes

This PR fixes rust-lang/rust#158008.

In particular, in rust-lang/rust#150129, it refactored some code within `library/std/io/mod.rs` to utilize `BorrowedBuf::is_init` instead of manually checking `read_buf.init_len() == buf_len` to see if the read buffer had initialized bytes. However, the `BorrowedBuf` is never marked or set as init within this function, and I think this portion of the code:
```rust
 // SAFETY: These bytes were initialized but not filled in the previous loop
unsafe {
     read_buf.set_init(initialized);
}
```
was removed by mistake. This PR reverts the changes made by rust-lang/rust#150129, so that we can mark the `BorrowedBuf`/`read_buf` as initialized using `BorrowedBuf::set_init` if in a previous iteration the cursor has initialized bytes. This would allow `max_read_size` to not be marked as `usize::max` if the read buffer contains initialized bytes.

Closes: rust-lang/rust#142872
2026-08-11 11:14:52 +02:00
Jonathan Brouwer
8cd8b73209 Rollup merge of #156338 - P8L1:derive-reborrow-coerce-shared, r=oli-obk
Implement derives for Reborrow and CoerceShared

This adds built-in derive support for the experimental `Reborrow` and `CoerceShared` marker traits behind `#![feature(reborrow)]`.

The derives generate the same marker impls users would write manually, while preserving the existing coherence and structural validation path for the experimental reborrow traits.

## Please note this impl:

- Preserves generics, lifetimes, const params, and where clauses in generated impls.
- Preserves multiple lifetime parameters in generated impls instead of duplicating the current experimental one-lifetime limitation in the derive layer.
- Requires an explicit `CoerceShared` target type through the derive helper attribute.
- Adds UI coverage for valid derives, feature gating, malformed helper attributes, unsupported item kinds, validation failures, and multiple-lifetime derive behavior.
- Makes the derive layer future-proof for multiple lifetimes: it preserves all lifetime parameters and generates the same impl shape as a manual impl.

@rustbot label F-reborrow
Tracking: https://github.com/rust-lang/rust/issues/145612
2026-08-11 11:14:51 +02:00
bors
f76a50bb82 Auto merge of #160818 - Mark-Simulacrum:smaller-try, r=Kobzol
Switch try jobs to c8a.8xlarge

This also expands the instance type list. Our current selection (12xlarge) is at best 2-3 minutes faster than 8xlarge based on rough benchmarks, which isn't worth the extra ~$0.72/build. See description of https://github.com/rust-lang/simpleinfra/issues/1132 for those results.

We expand the instance list to include even smaller instances because we might experiment with using those smaller instances for non-try jobs (e.g., auto and unrolled perf builds) because latency matters less there. That's not done in this commit though.

Unfortunately I think we cannot easily test this before landing it, since AFAICT bors will read the configuration only once it's actually on main. https://github.com/rust-lang/bors-kindergarten/pull/59 (once merged) should give us some test experience with this before we proceed with things in rust-lang/rust.

r? Kobzol
2026-08-11 07:32:51 +00:00
Pieter-Louis Schoeman
599fbed7fe Implement derives for Reborrow and CoerceShared 2026-08-11 06:48:53 +00:00
bors
0913b18e48 Auto merge of #160888 - jhpratt:rollup-OY2pQdT, r=jhpratt
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#160872 (Add back homu-ignore markers around the PR template)
 - rust-lang/rust#160432 (core: generalize `BorrowedCursor::ensure_init`)
 - rust-lang/rust#160843 (Overhaul `rustc_query_impl`)
 - rust-lang/rust#160865 (use `static` instead of `const` for derive(Debug))
 - rust-lang/rust#160866 (Update books)
 - rust-lang/rust#160881 (Implement <OnceCell,OnceLock>::new_init)
2026-08-11 04:22:47 +00:00
Jacob Pratt
80fdf73bad Rollup merge of #160881 - malezjaa:implement_new_init, r=clarfonthey
Implement <OnceCell,OnceLock>::new_init

Tracking issues: rust-lang/rust#159859 rust-lang/rust#159860

I'm not sure If I was supposed to add any other tests apart from the doc tests.
2026-08-10 23:49:39 -04:00
Jacob Pratt
4da59a3971 Rollup merge of #160866 - rustbot:docs-update, r=traviscross
Update books

## rust-lang/reference

9 commits in afdc77bab886d4455c11247cdd32391bfab636ae..82da570bafd9efed421bdbae0f8603ede8dd308b
2026-08-08 22:04:17 UTC to 2026-07-28 18:20:15 UTC

- add c-variadic function definitions (rust-lang/reference#2177)
- Update `no_mangle` to use the attribute template (rust-lang/reference#1904)
- enums with fields: clarify that repr(C, int) is quite different from repr(int) (rust-lang/reference#2227)
- aliasing rules also apply inside private fields (rust-lang/reference#2304)
- attributes: do not explain syntax in rules (rust-lang/reference#2306)
- Document prohibition on inner attribute macros (rust-lang/reference#2311)
- Use authentication for linkcheck (rust-lang/reference#2319)
- Stabilize passing 128-bit integers via vector registers with `asm!` on x86 (rust-lang/reference#2313)
- Add a rule for attribute macro outline modules (rust-lang/reference#2310)
2026-08-10 23:49:38 -04:00
Jacob Pratt
9b7bae2ac9 Rollup merge of #160865 - makai410:debug-static, r=nnethercote
use `static` instead of `const` for derive(Debug)

r? @ghost
2026-08-10 23:49:37 -04:00
Jacob Pratt
20b2fd7d1c Rollup merge of #160843 - nnethercote:overhaul-rustc_query_impl, r=Zalathar
Overhaul `rustc_query_impl`

The file/module structure is all over the place. In particular, `plumbing.rs` and `query_impl.rs` are pretty meaningless file names.

r? @Zalathar
2026-08-10 23:49:37 -04:00
Jacob Pratt
45109098e7 Rollup merge of #160432 - joboet:ensure_init_generic, r=clarfonthey
core: generalize `BorrowedCursor::ensure_init`

Tracking issue: https://github.com/rust-lang/rust/issues/160476

This implements the future possibility left out in https://github.com/rust-lang/rust/pull/149749#issue-3704149674 and makes `ensure_init` generic over `Default`. I used specialisation to make sure the performance in the `u8` case stays equivalent to `memset` irrespective of how clever the optimiser happens to be.

CC @joshtriplett as you've been working on this stuff recently.

This also adds a public `write_default` method on `[MaybeUninit<T>]` that's doing the equivalent of `.write_init(|_| Default::default())`, but uses specialisation for integers. This uses the existing [tracking issue for `maybe_uninit_fill`](https://github.com/rust-lang/rust/issues/117428).
2026-08-10 23:49:36 -04:00
Jacob Pratt
98ce15951e Rollup merge of #160872 - steffahn:put_back_homu-ignore, r=jieyouxu
Add back homu-ignore markers around the PR template

Besides reinstantiating the `homu-ignore` markers from rust-lang/rust#126501, this PR also adds better clarification how the homu-ignore markers actually work; I've then also moved that section further down as it seems less important than the other parts of the PR template message. (We shouldn't forget that this is a *general PR template message*, not a LLM-policy-specific message.)

The disclosure markers appear to have been accidentally removed together with the checkboxes in rust-lang/rust#160785.

In the future, if support for ignoring HTML comments in places such as markdown code blocks was added, the new description about how `<!-- homu-ignore:end -->`/`<!-- homu-ignore:start -->` can be used could be further simplified[^1], but I'd like to address the immediate issues first before considering any more involved improvements (there already *exist* [currently ~~6~~ 8] new PRs now that contain the whole template comment without `homu-ignore` markers).

[^1]: actually it may always stay non-ideal given that HTML comments don't nest 🫠
2026-08-10 23:49:35 -04:00
Nicholas Nethercote
86c2ea09e1 Remove the crate's doc comment
It's out of date.
2026-08-11 12:54:31 +10:00
Nicholas Nethercote
d6c550356a Rename profiling_support.rs as self_profile.rs
It's a clearer name.
2026-08-11 12:54:24 +10:00
Nicholas Nethercote
ae1b655c80 Move some job-related stuff into job.rs 2026-08-11 12:54:24 +10:00
Nicholas Nethercote
b99843c7a2 Move GetQueryVTable into query_vtables.rs
It's a more sensible home than `lib.rs`.
2026-08-11 12:54:24 +10:00
Nicholas Nethercote
04df355d86 Rename plumbing.rs as incremental.rs
Because it now contains only things related to incremental. Also move
two functions relating to incremental from `execution.rs` to
`incremental.rs`.
2026-08-11 12:54:24 +10:00
Nicholas Nethercote
c0b0065f06 Move four functions from plumbing.rs to execution.rs
These four functions are all only used within `execution.rs`, so they no
longer need `pub(crate)`.

This is the first step toward eliminating `plumbing.rs`.
2026-08-11 12:54:24 +10:00
Nicholas Nethercote
9e37f3950e Rename query_impl.rs as query_vtables.rs
The current name is very generic and the file is mostly about query
vtables.
2026-08-11 12:54:24 +10:00
Nicholas Nethercote
9e2147f559 Move create_cycle_error to mod handle_cycle_error
It's a more sensible home than `mod job`.
2026-08-11 12:54:24 +10:00
Nicholas Nethercote
0f7dbc062c Fix a use item
`lib.rs` imports `DepNode`/`DepNodeIndex` even though it doesn't use
them directly. And then `execution.rs` uses that one. Weird.

This commit fixes things to be more normal.
2026-08-11 12:54:24 +10:00
Zalathar
55050c13e5 Tidy imports in lib.rs
There is no need to re-export anything, so all `pub use` imports can be
simplified to `use` and merged with their siblings.
2026-08-11 11:48:17 +10:00
Zalathar
d14e7c41d7 Make bootstrap's main.rs a stub that calls into the library crate
If there is non-trivial code in `main.rs`, then any items it touches need to be
publicly exported from the library crate. Those public exports make it harder
to identify unused code within bootstrap.
2026-08-11 11:45:10 +10:00
Zalathar
b189f6e09f Move and rename bootstrap's main.rs
This intermediate commit helps to preserve line history.
2026-08-11 11:45:10 +10:00
Mahdi Ali-Raihan
9e13b0a69e Re-calibrate init_until to how many bytes are actually initialized and filled in the buffer when reallocation occurs 2026-08-10 21:16:32 -04:00
bors
0e72e3266c Auto merge of #160879 - JonathanBrouwer:rollup-4zAylRT, r=JonathanBrouwer
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#160629 ([Priroda] Add bootstrap test and check steps)
 - rust-lang/rust#160811 (Fix `visible_parent_map` fallback map merging perf regression)
 - rust-lang/rust#154329 (Diagnostics ICE when replaying proof trees with next-solver)
 - rust-lang/rust#157841 (Ensure inferred let pattern types are well-formed)
 - rust-lang/rust#159300 (Implement `to_string()` on `ByteStr` and `ByteString`)
 - rust-lang/rust#160858 (Add regression test for assoc const panic ICE in match)
 - rust-lang/rust#160864 (Rename `HostEffectPredicate` to `HostEffectClause`)
2026-08-11 01:10:47 +00:00
Frank Steffahn
0bcefa1ec7 Add back homu-ignore markers around the PR template
Also clarify how the homu-ignore markers actually work.
2026-08-11 01:16:48 +02:00
malezjaa
34b02c630a implement <OnceCell,OnceLock>::new_init 2026-08-11 00:46:20 +02:00
bors
fdda4c6a30 Auto merge of #160801 - nnethercote:new-solver-probes, r=jdonszelmann
Optimize new solver unification table ops

The current code uses the `ena` crate in sub-optimal ways. Improving this gives big speed wins for the new trait solver on some benchmarks. Details in individual commits.

r? @lcnr
2026-08-10 22:02:56 +00:00
Jonathan Brouwer
d3a5cbca18 Rollup merge of #160864 - ada4a:rename-HostEffectPredicate, r=oli-obk
Rename `HostEffectPredicate` to `HostEffectClause`

Part of https://github.com/rust-lang/rust/issues/107250

r? oli-obk
2026-08-10 23:43:33 +02:00
Jonathan Brouwer
46f532df2a Rollup merge of #160858 - zakrad:regr-test-91514, r=JohnTitor
Add regression test for assoc const panic ICE in match

Closes rust-lang/rust#91514, The associated const panic!() in a match used to ICE and now fails const eval cleanly
2026-08-10 23:43:33 +02:00
Jonathan Brouwer
b3459aec1b Rollup merge of #159300 - DanielEScherzer:bytestr-to-string, r=clarfonthey
Implement `to_string()` on `ByteStr` and `ByteString`
2026-08-10 23:43:32 +02:00
Jonathan Brouwer
ac84f4a4cd Rollup merge of #157841 - Kivooeo:fix-let-pat-inferred-wf, r=lcnr
Ensure inferred let pattern types are well-formed

same as https://github.com/rust-lang/rust/pull/157013 but with crater and fpc

r? lcnr
2026-08-10 23:43:31 +02:00
Jonathan Brouwer
ef94a79a3c Rollup merge of #154329 - VicenteGusmao:fix-bug-151304, r=lcnr
Diagnostics ICE when replaying proof trees with next-solver

When diagnostics replay proof tree state, rebuilding a canonical state can fail to match the current inference state. With -Znext-solver=globally, this could panic while reporting an error, avoiding the panic.

Make proof tree replay fallible in diagnostics and fall back to the current obligation when replay fails. Add a regression test for the higher-ranked PartialEq and PartialOrd case. Fixes rust-lang/rust#151304.
2026-08-10 23:43:31 +02:00
Jonathan Brouwer
65c0a8bdb1 Rollup merge of #160811 - zalanlevai:160464-perf-regression, r=JonathanBrouwer
Fix `visible_parent_map` fallback map merging perf regression

This PR attempts to fix the `visible_parent_map` perf regression introduced in rust-lang/rust#160464, which was found in a [post-merge perf run](https://github.com/rust-lang/rust/pull/160464#issuecomment-5231136940).

Because the original PR fixes unnecessary iterations in the breadth-first search (BFS), meaning that it only reduces the amount of work during the BFS, the likely cause of the perf regression is the changed merging of the fallback map into the final visible parent map after the BFS.

The goal of this PR is to determine whether this is the case through a perf try run. The change itself works around the Unord* APIs, but might be worth it to work around the perf regression.
2026-08-10 23:43:30 +02:00
Jonathan Brouwer
e84bdbd702 Rollup merge of #160629 - moabo3li:priroda-bootstrap-ci, r=oli-obk
[Priroda] Add bootstrap test and check steps

The priroda crate lives under src/tools/miri/priroda and shares miri's sysroot and toolchain setup, so register a test step that mirrors the existing miri one and a check step alongside cargo-miri.

r? oli-obk
2026-08-10 23:43:29 +02:00
Daniel Scherzer
bb32b7c771 Implement to_string() on ByteStr and ByteString
Add an inherent `to_string()` method to `ByteStr` and `ByteString` that returns
`Result<String, Utf8Error>`, overriding the `to_string()` method made available
by the blanket implementation of `ToString` for all types that implement
`Display`.

Gate the new `to_string()` methods, and the existing `Display` implementations,
behind a new feature flag, `bstr_to_string`.
2026-08-10 14:03:21 -07:00
Jonathan Brouwer
93bc4e8941 Remove crash-test
Co-authored-by: s7tya <53410646+s7tya@users.noreply.github.com>
2026-08-10 21:40:09 +02:00