Skip to content

Use build_scope_drops instead of open-coding drop ladders - #160188

Draft
cjgillot wants to merge 3 commits into
rust-lang:mainfrom
cjgillot:build-scope-drops
Draft

cjgillot wants to merge 3 commits into
rust-lang:mainfrom
cjgillot:build-scope-drops

Conversation

@cjgillot

Copy link
Copy Markdown
Contributor

r? @ghost

@rustbot rustbot added F-explicit_tail_calls `#![feature(explicit_tail_calls)]` S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 30, 2026
@cjgillot

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 30, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 30, 2026
Use `build_scope_drops` instead of open-coding drop ladders
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-miri failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests/fail/tree_borrows/wildcard/subtree_internal_relatedness_wildcard.rs ... ok
tests/fail/tree_borrows/wildcard/subtree_internal_relatedness.rs ... ok

FAILED TEST: tests/fail/tail_calls/dangling-local-var.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-hC6Omq" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/miri" "--error-format=json" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/fail/tail_calls" "tests/fail/tail_calls/dangling-local-var.rs" "--edition" "2021"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/tail_calls/dangling-local-var.stderr` to the actual output
--- tests/fail/tail_calls/dangling-local-var.stderr
+++ <stderr output>
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
   --> tests/fail/tail_calls/dangling-local-var.rs:LL:CC
... 12 lines skipped ...
   --> tests/fail/tail_calls/dangling-local-var.rs:LL:CC
    |
-LL |     let _val = unsafe { *x };
+LL | }
-   |         ^^^^
+   | ^
    = note: stack backtrace:
            0: g
---
Full unnormalized output:
error: Undefined Behavior: memory access failed: alloc168 has been freed, so this pointer is dangling
##[error]  --> tests/fail/tail_calls/dangling-local-var.rs:5:25
   |
LL |     let _val = unsafe { *x };
   |                         ^^ Undefined Behavior occurred here
   |
   = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
   = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
help: alloc168 was allocated here:
  --> tests/fail/tail_calls/dangling-local-var.rs:9:9
---
full stderr:
error: Undefined Behavior: memory access failed: alloc168 has been freed, so this pointer is dangling
##[error]  --> tests/fail/tail_calls/dangling-local-var.rs:5:25
   |
LL |     let _val = unsafe { *x };
   |                         ^^ Undefined Behavior occurred here
   |
   = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
   = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
help: alloc168 was allocated here:
  --> tests/fail/tail_calls/dangling-local-var.rs:9:9
---

Location:
   /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ui_test-0.30.7/src/lib.rs:365

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
error: test failed, to rerun pass `--test ui`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/build/miri/855274d73082e308/out/ui-855274d73082e308` (exit status: 1)
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo test --target x86_64-unknown-linux-gnu -Zbinary-dep-depinfo -j 4 -Zroot-dir=/checkout --locked --color=always --profile=release --manifest-path /checkout/src/tools/miri/Cargo.toml -- [workdir=/checkout]` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:197:21
Executed at: src/bootstrap/src/core/build_steps/test.rs:770:19

Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `test --stage 2 src/tools/miri src/tools/miri/cargo-miri`
Currently active steps:
test::Miri { target: x86_64-unknown-linux-gnu } at src/bootstrap/src/core/build_steps/test.rs:696
Build completed unsuccessfully in 0:49:21
  local time: Thu Jul 30 00:53:59 UTC 2026

@rust-bors

rust-bors Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: aba66a0 (aba66a0f1dd6d8ac0a2926a832992999b77d79b9)
Base parent: 1a833e1 (1a833e16546c2eb012758ddd499964fd8afee29e)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown

Finished benchmarking commit (aba66a0): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.9%, secondary 0.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.9% [0.4%, 5.2%] 4
Regressions ❌
(secondary)
0.9% [0.4%, 4.4%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.0% [-5.0%, -5.0%] 1
All ❌✅ (primary) 2.9% [0.4%, 5.2%] 4

Cycles

Results (primary 0.3%, secondary -5.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.1% [0.4%, 2.3%] 6
Regressions ❌
(secondary)
1.0% [0.4%, 4.1%] 9
Improvements ✅
(primary)
-0.5% [-0.7%, -0.4%] 5
Improvements ✅
(secondary)
-10.2% [-17.3%, -0.7%] 13
All ❌✅ (primary) 0.3% [-0.7%, 2.3%] 11

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 497.309s -> 500.664s (0.67%)
Artifact size: 390.20 MiB -> 390.22 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-explicit_tail_calls `#![feature(explicit_tail_calls)]` S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants