Skip to content

Conversation

@RalfJung
Copy link
Member

No description provided.

@rustbot rustbot added 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 26, 2025
@RalfJung RalfJung changed the title perf experiment (2): try to replace box_new with intrinsic perf experiment (2): try to get rid of box_new Oct 26, 2025
@RalfJung
Copy link
Member Author

@bors try
@rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 26, 2025
perf experiment (2): try to get rid of box_new
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 26, 2025
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
+    |              ^^^^^^^^
15    |
-    = note: function calls are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html>
+    = note: see issue #86935 <https://github.com/rust-lang/rust/issues/86935> for more information
+    = help: add `#![feature(more_qualified_paths)]` to the crate attributes to enable
+    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
17    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
18 
- error[E0164]: expected tuple struct or tuple variant, found associated function `::alloc::boxed::Box::new_uninit`
+ error[E0164]: expected tuple struct or tuple variant, found associated function `<[_]>::into_vec`
20   --> $DIR/vec-macro-in-pattern.rs:7:14
21    |
22 LL |         Some(vec![43]) => {}

27 
---
To only update this specific test, also pass `--test-args macros/vec-macro-in-pattern.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/macros/vec-macro-in-pattern.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/macros/vec-macro-in-pattern" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0532]: expected a pattern, found a function call
##[error]  --> /checkout/tests/ui/macros/vec-macro-in-pattern.rs:7:14
   |
LL |         Some(vec![43]) => {} //~ ERROR expected a pattern, found a function call
   |              ^^^^^^^^ not a tuple struct or tuple variant
   |
   = note: function calls are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html>
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: usage of qualified paths in this context is experimental
##[error]  --> /checkout/tests/ui/macros/vec-macro-in-pattern.rs:7:14
   |
LL |         Some(vec![43]) => {} //~ ERROR expected a pattern, found a function call
   |              ^^^^^^^^
   |
   = note: see issue #86935 <https://github.com/rust-lang/rust/issues/86935> for more information
   = help: add `#![feature(more_qualified_paths)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0164]: expected tuple struct or tuple variant, found associated function `<[_]>::into_vec`
##[error]  --> /checkout/tests/ui/macros/vec-macro-in-pattern.rs:7:14
   |
LL |         Some(vec![43]) => {} //~ ERROR expected a pattern, found a function call
   |              ^^^^^^^^ `fn` calls are not allowed in patterns
   |
   = help: for more information, visit https://doc.rust-lang.org/book/ch19-00-patterns.html
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 3 previous errors
---

+ error[E0503]: cannot use `x` because it was mutably borrowed
+   --> $DIR/regions-escape-loop-via-vec.rs:5:11
+    |
+ LL |     let mut _y = vec![&mut x];
+    |                       ------ `x` is borrowed here
+ LL |     while x < 10 {
+    |           ^ use of borrowed `x`
+ LL |         let mut z = x;
+ LL |         _y.push(&mut z);
+    |         -- borrow later used here
+ 
+ error[E0503]: cannot use `x` because it was mutably borrowed
+   --> $DIR/regions-escape-loop-via-vec.rs:6:21
+    |
+ LL |     let mut _y = vec![&mut x];
+    |                       ------ `x` is borrowed here
+ LL |     while x < 10 {
+ LL |         let mut z = x;
+    |                     ^ use of borrowed `x`
+ LL |         _y.push(&mut z);
+    |         -- borrow later used here
+ 
1 error[E0597]: `z` does not live long enough
2   --> $DIR/regions-escape-loop-via-vec.rs:7:17
3    |
---
- error: aborting due to 1 previous error
+ error[E0503]: cannot use `x` because it was mutably borrowed
+   --> $DIR/regions-escape-loop-via-vec.rs:9:9
+    |
+ LL |     let mut _y = vec![&mut x];
+    |                       ------ `x` is borrowed here
+ ...
+ LL |         _y.push(&mut z);
+    |         -- borrow later used here
+ LL |
+ LL |         x += 1;
+    |         ^^^^^^ use of borrowed `x`
15 
---
- LL |         //~^ ERROR `z` does not live long enough
+ error[E0503]: cannot use `x` because it was mutably borrowed
+   --> $DIR/regions-escape-loop-via-vec.rs:5:11
+    |
+ LL |     let mut _y = vec![&mut x];
+    |                       ------ `x` is borrowed here
+ LL |     while x < 10 {
+    |           ^ use of borrowed `x`
+ LL |         let mut z = x;
+ LL |         _y.push(&mut z);
+    |         -- borrow later used here
+ 
+ error[E0503]: cannot use `x` because it was mutably borrowed
+   --> $DIR/regions-escape-loop-via-vec.rs:6:21
+    |
+ LL |     let mut _y = vec![&mut x];
+    |                       ------ `x` is borrowed here
+ LL |     while x < 10 {
+ LL |         let mut z = x;
+    |                     ^ use of borrowed `x`
+ LL |         _y.push(&mut z);
+    |         -- borrow later used here
+ 
+ error[E0503]: cannot use `x` because it was mutably borrowed
+   --> $DIR/regions-escape-loop-via-vec.rs:9:9
+    |
+ LL |     let mut _y = vec![&mut x];
+    |                       ------ `x` is borrowed here
+ ...
+ LL |         _y.push(&mut z);
+    |         -- borrow later used here
+ LL |
+ LL |         x += 1;
+    |         ^^^^^^ use of borrowed `x`
+ error: aborting due to 4 previous errors
---
To only update this specific test, also pass `--test-args span/regions-escape-loop-via-vec.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/span/regions-escape-loop-via-vec.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/span/regions-escape-loop-via-vec" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0503]: cannot use `x` because it was mutably borrowed
##[error]  --> /checkout/tests/ui/span/regions-escape-loop-via-vec.rs:5:11
   |
LL |     let mut _y = vec![&mut x];
   |                       ------ `x` is borrowed here
LL |     while x < 10 {
   |           ^ use of borrowed `x`
LL |         let mut z = x;
LL |         _y.push(&mut z);
   |         -- borrow later used here

error[E0503]: cannot use `x` because it was mutably borrowed
##[error]  --> /checkout/tests/ui/span/regions-escape-loop-via-vec.rs:6:21
   |
LL |     let mut _y = vec![&mut x];
   |                       ------ `x` is borrowed here
LL |     while x < 10 {
LL |         let mut z = x;
   |                     ^ use of borrowed `x`
LL |         _y.push(&mut z);
   |         -- borrow later used here

error[E0597]: `z` does not live long enough
##[error]  --> /checkout/tests/ui/span/regions-escape-loop-via-vec.rs:7:17
   |
LL |         let mut z = x;
   |             ----- binding `z` declared here
LL |         _y.push(&mut z);
   |         --      ^^^^^^ borrowed value does not live long enough
   |         |
   |         borrow later used here
...
LL |     }
   |     - `z` dropped here while still borrowed

error[E0503]: cannot use `x` because it was mutably borrowed
##[error]  --> /checkout/tests/ui/span/regions-escape-loop-via-vec.rs:9:9
   |
LL |     let mut _y = vec![&mut x];
   |                       ------ `x` is borrowed here
...
LL |         _y.push(&mut z);
   |         -- borrow later used here
LL |         //~^ ERROR `z` does not live long enough
LL |         x += 1;
   |         ^^^^^^ use of borrowed `x`

@rust-bors
Copy link

rust-bors bot commented Oct 26, 2025

☀️ Try build successful (CI)
Build commit: 28e96bb (28e96bb5904e008fd6f37605d2027d43de86ba93, parent: 2888098522be731065efe51f85eaba8b49fee1a5)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (28e96bb): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@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.6% [0.1%, 1.3%] 9
Improvements ✅
(primary)
-0.7% [-0.9%, -0.6%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.7% [-0.9%, -0.6%] 2

Max RSS (memory usage)

Results (primary 1.0%, secondary -2.3%)

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

mean range count
Regressions ❌
(primary)
3.7% [1.0%, 7.4%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.7% [-2.3%, -0.5%] 3
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) 1.0% [-2.3%, 7.4%] 6

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

Results (primary 0.1%, secondary 2.3%)

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

mean range count
Regressions ❌
(primary)
0.2% [0.0%, 0.6%] 29
Regressions ❌
(secondary)
2.3% [0.5%, 3.6%] 16
Improvements ✅
(primary)
-0.4% [-0.5%, -0.3%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.5%, 0.6%] 35

Bootstrap: 476.488s -> 475.627s (-0.18%)
Artifact size: 390.47 MiB -> 390.49 MiB (0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. 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. T-libs Relevant to the library 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