Repository navigation
Rollup of 8 pull requests - #164974
Closed
JonathanBrouwer wants to merge 19 commits into
Closed
Rollup of 8 pull requests#164974JonathanBrouwer wants to merge 19 commits into
JonathanBrouwer wants to merge 19 commits into
Conversation
`LeafRegionConstraint`, `Or`, `And`, and `RegionConstraint` defaulted their span parameter to `()`, which reads as an empty tuple rather than as "this constraint has no span". Add a `NoSpan` unit struct and use it as the default, and add a `ConstraintSpan` trait implemented for `NoSpan` and `rustc_span::Span`. This replaces the repeated `Clone + Debug + Eq + Hash` bounds on the constructors and span conversion helpers. No behavior change.
It's unused and there's no real reason for it to exist.
`process::output` on UEFI applies the child's environment changes to the process-global UEFI environment and restores them after `start_image`. If `start_image` returned an error, the `?` returned early before the rollback ran, leaking the child's variables (e.g. `path`) into the parent. Restore the environment unconditionally and only then propagate the error.
It's best to use `Span` methods because `SpanData` is mostly an internal detail, and to avoid unnecessary `SPAN_TRACK` calls. In the following cases, removing the `data()` gives identical behaviour: - `span.data().lo` --> `span.lo()` - `span.data().hi` --> `span.hi()` - `span.data().lo` + `span.data().hi` --> `span.lo_hi()` In the following case, removing the `data_untracked()` gives identical behaviour: - `span.data_untracked().parent` --> `span.parent()` In the following case, removing the `data` removes an unnecessary `SPAN_TRACK` call (because `SPAN_TRACK` is only needed for lo/hi accesses): - `span.data().ctxt` --> `span.ctxt()`
…ndles-len, r=joboet Use the updated buffer length in UEFI locate_handles locate_handles was using the handle count from the first LocateHandle call when setting the vec length, instead of the size the second call actually wrote. If handles go away between the two calls this marks uninitialized entries as initialized. Use the updated buf_len instead. Fixes rust-lang#164945
…n-spawn-failure, r=joboet uefi: roll back env changes when `start_image` fails Fixes rust-lang#164949 On UEFI, `process::output` applies the child's environment changes to the process-global UEFI environment and rolls them back after `start_image`. If `start_image` returned an error, the `?` returned early before the rollback ran, so the child's variables (notably `path`, which later `resolve_program` lookups depend on) leaked permanently into the parent. This keeps the `start_image` result, restores the environment unconditionally, and only then propagates the error. Tested with `./x check library --target x86_64-unknown-uefi`, `./x fmt --check` and `./x test tidy`. I have not run it on UEFI hardware or under QEMU. cc @dvdhrm @nicholasbishop (UEFI target maintainers)
…ts, r=joboet thread_local::guard: update comments a bit The `thread_current_in_dtor` test recently failed in Miri so I had to dig into this. - Mention at the top that this file is also responsible for calling `rt::thread_cleanup`. - The comments used to skip some reasoning steps, probably taking them for granted. Add a bit more detail to make them easier to follow. r? @joboet
…-sub, r=lcnr Remove the 'sub' method from 'At' and migrate to 'sub_raw' Continuation of rust-lang#163978, similar scope to rust-lang#164244.
…yperia Use a NoSpan marker for region constraints without spans `LeafRegionConstraint`, `Or`, `And`, and `RegionConstraint` defaulted their span parameter to `()`, which reads as an empty tuple rather than as "this constraint has no span". Add a `NoSpan` unit struct and use it as the default, and add a `ConstraintSpan` trait implemented for `NoSpan` and `rustc_span::Span`. This replaces the repeated `Clone + Debug + Eq + Hash` bounds on the constructors and span conversion helpers.
Switch from `insta` to `expect-test` in bootstrap While I like `insta` a bit more for snapshot tests, it has a disadvantage that it requires installing a separate binary (`cargo insta`) for blessing *inline* snapshot tests. That is not very intuitive for people who need to bless inline bootstrap snapshots, and then realize that `x test bootstrap --bless` does nothing. This PR switches from `insta` to `expect-test`, which allows updating inline snapshots via an environment variable while running `cargo test`, without requiring a separate binary. `expect-test` is a `rust-lang` (well, `rust-analyzer`) [repository](https://github.com/rust-analyzer/expect-test), so we should be good there, and it even removes two `dev` dependencies from bootstrap. Changing the inline snapshots was a bit non-trivial to do with a regex (at least in my IDE) because we have to switch the argument order, which is not that simple across multiple lines. So I decided to try https://github.com/ast-grep/ast-grep. I used an LLM to propose the initial rewrite rule, and then modified it slightly and ran `ast-grep` to update the code. The applied rule was this: ```yaml id: insta-to-expect-test language: rust rule: pattern: insta::assert_snapshot!($$$ARGS) transform: LHS: replace: source: $$$ARGS replace: '(?s)^(?<lhs>.*?),\s*@(?<rhs>.*?)\s*,?\s*$' by: '${lhs}' RHS: replace: source: $$$ARGS replace: '(?s)^(?<lhs>.*?),\s*@(?<rhs>.*?)\s*,?\s*$' by: '${rhs}' fix: expect_test::expect![[$RHS]].assert_eq(&$LHS) ``` You can test it in the `ast-grep` [playground](https://ast-grep.github.io/playground.html#eyJtb2RlIjoiQ29uZmlnIiwibGFuZyI6InJ1c3QiLCJxdWVyeSI6IiIsInJld3JpdGUiOiJzb3VyY2U6ICQkJEFSR1NcbnJlcGxhY2U6ICcoP3MpXig/PGxocz4uKj8pLFxccypAKD88cmhzPi4qPylcXHMqLD9cXHMqJCdcbmJ5OiAnJHtyaHN9JyIsInN0cmljdG5lc3MiOiJzbWFydCIsInNlbGVjdG9yIjoiIiwiY29uZmlnIjoiaWQ6IGluc3RhLXRvLWV4cGVjdC10ZXN0XG5sYW5ndWFnZTogcnVzdFxucnVsZTpcbiAgcGF0dGVybjogaW5zdGE6OmFzc2VydF9zbmFwc2hvdCEoJCQkQVJHUylcbnRyYW5zZm9ybTpcbiAgTEhTOlxuICAgIHJlcGxhY2U6XG4gICAgICBzb3VyY2U6ICQkJEFSR1NcbiAgICAgIHJlcGxhY2U6ICcoP3MpXig/PGxocz4uKj8pLFxccypAKD88cmhzPi4qPylcXHMqLD9cXHMqJCdcbiAgICAgIGJ5OiAnJHtsaHN9J1xuICBSSFM6XG4gICAgcmVwbGFjZTpcbiAgICAgIHNvdXJjZTogJCQkQVJHU1xuICAgICAgcmVwbGFjZTogJyg/cyleKD88bGhzPi4qPyksXFxzKkAoPzxyaHM+Lio/KVxccyosP1xccyokJ1xuICAgICAgYnk6ICcke3Joc30nXG5maXg6IGV4cGVjdF90ZXN0OjpleHBlY3QhWyRSSFNdLmFzc2VydF9lcSgmJExIUykiLCJzb3VyY2UiOiJpbnN0YTo6YXNzZXJ0X3NuYXBzaG90IShcbiAgICAgICAgICAgIGN0eC5jb25maWcoXCJidWlsZFwiKVxuICAgICAgICAgICAgICAgIC5yZW5kZXJfc3RlcHMoKSwgQHJcIlxuICAgICAgICBbYnVpbGRdIGxsdm0gPGhvc3Q+XG4gICAgICAgIFtidWlsZF0gcnVzdGMgMCA8aG9zdD4gLT4gcnVzdGMgMSA8aG9zdD5cbiAgICAgICAgW2J1aWxkXSBydXN0YyAxIDxob3N0PiAtPiBzdGQgMSA8aG9zdD5cbiAgICAgICAgW2J1aWxkXSBydXN0ZG9jIDEgPGhvc3Q+XG4gICAgICAgIFwiLFxuICAgICAgICApOyJ9). I used double brackets because it formatted better (IMO) with `x fmt`. Most of the diff comes from the this mechanical change. I split it into a separate commit for easier review. I tried to replicate the disk snapshots as closely as possible, by even including the source file path in them, though I think it is not very useful. There are some newline changes in a few tests, I didn't feel like it is worth fixing those. CC @Zalathar I suppose that we should do the same for `citool`, I can send that as a follow-up. Fixes: rust-lang#164837
…ds, r=hanna-kruppe Remove redundant vec and duplicate indexing in find_noop_landing_pads The original code looks like some refactoring artifact. The `map().collect()` chain is redundant because the `vec` is immediately turned into iterator again, and it throws away the `BasicBlockData` reference just to look it up again in the main loop.
…us-easy, r=Kivooeo Reduce `SpanData` use `SpanData` is mostly an internal detail, and using `Span` is preferable where possible. Details in individual commits. r? @Kivooeo
Member
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 26, 2026
Rollup of 8 pull requests try-job: dist-various-1 try-job: test-various try-job: test-x86_64-gnu-aux try-job: test-x86_64-msvc-1 try-job: test-aarch64-apple-1 try-job: test-aarch64-apple-2 try-job: test-x86_64-mingw-1 try-job: test-i686-msvc try-job: test-armhf-gnu try-job: test-x86_64-gnu-llvm-22-3
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 26, 2026
…uwer Rollup of 8 pull requests Successful merges: - #164955 (Use the updated buffer length in UEFI locate_handles) - #164958 (uefi: roll back env changes when `start_image` fails) - #164968 (thread_local::guard: update comments a bit) - #164303 (Remove the 'sub' method from 'At' and migrate to 'sub_raw') - #164674 (Use a NoSpan marker for region constraints without spans) - #164856 (Switch from `insta` to `expect-test` in bootstrap) - #164934 (Remove redundant vec and duplicate indexing in find_noop_landing_pads) - #164954 (Reduce `SpanData` use)
Contributor
|
💔 Test for c37efc9 failed: CI. Failed job:
|
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
PR #164856, which is a member of this rollup, was unapproved. |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
start_imagefails #164958 (uefi: roll back env changes whenstart_imagefails)instatoexpect-testin bootstrap #164856 (Switch frominstatoexpect-testin bootstrap)SpanDatause #164954 (ReduceSpanDatause)r? @ghost
Create a similar rollup