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-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 20, 2025
@RalfJung
Copy link
Member Author

@bors try
@rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

rust-bors bot added a commit that referenced this pull request Oct 20, 2025
perf experiment: try to replace box_new with write_via_move
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 20, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Oct 20, 2025

💔 Test for 6516a74 failed: CI. Failed jobs:

@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 20, 2025
perf experiment: try to replace box_new with write_via_move
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Oct 20, 2025

💔 Test for b7ef2e7 failed: CI. Failed jobs:

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
   Compiling collector v0.1.0 (/tmp/tmp-multistage/opt-artifacts/rustc-perf/collector)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 31.61s
[2025-10-20T13:20:37.923Z INFO  opt_dist::timer] Section `Stage 1 (Rustc PGO)` starts
[2025-10-20T13:20:37.923Z INFO  opt_dist::timer] Section `Stage 1 (Rustc PGO) > Build PGO instrumented rustc and LLVM` starts
[2025-10-20T13:20:37.923Z INFO  opt_dist::exec] Executing `RUST_BACKTRACE=full python3 /checkout/x.py build --target x86_64-unknown-linux-gnu --host x86_64-unknown-linux-gnu --stage 2 library/std --set rust.llvm-bitcode-linker=false --set build.extended=false --set rust.codegen-backends=['llvm'] --set rust.deny-warnings=false --rust-profile-generate /tmp/tmp-multistage/opt-artifacts/rustc-pgo --set llvm.thin-lto=false --set llvm.link-shared=true [at /checkout/obj]`
##[endgroup]
##[group]Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.06s
##[endgroup]
[TIMING:start] compile::Assemble { target_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false } }
---
[RUSTC-TIMING] icu_provider test:false 1.075
error[E0308]: mismatched types
   --> /rust/deps/schemars-1.0.4/src/generate.rs:83:26
    |
 83 |                 Box::new(RemoveRefSiblings),
    |                 -------- ^^^^^^^^^^^^^^^^^ expected `ReplaceUnevaluatedProperties`, found `RemoveRefSiblings`
    |                 |
    |                 arguments to this function are incorrect
    |
note: associated function defined here
   --> /rustc-dev/b7ef2e79c55f923c682e262312c8400bbc00f402/library/alloc/src/boxed.rs:261:12
    |
261 |     pub fn new(x: T) -> Self {
    |            ^^^

error[E0308]: mismatched types
   --> /rust/deps/schemars-1.0.4/src/generate.rs:84:26
    |
 84 |                 Box::new(ReplacePrefixItems),
    |                 -------- ^^^^^^^^^^^^^^^^^^ expected `ReplaceUnevaluatedProperties`, found `ReplacePrefixItems`
    |                 |
    |                 arguments to this function are incorrect
    |
note: associated function defined here
   --> /rustc-dev/b7ef2e79c55f923c682e262312c8400bbc00f402/library/alloc/src/boxed.rs:261:12
---
   |
42 |   macro_rules! vec {
   |   ---------------- in this expansion of `vec!`
...
62 |                       b.assume_init()
   |                       ^^^^^^^^^^^^^^^ expected `Box<[Box<dyn GenTransform>]>`, found `Box<[Box<...>; 3]>`
   |
  ::: /rust/deps/schemars-1.0.4/src/generate.rs:81:25
   |
81 |               transforms: vec![
   |  _________________________-
82 | |                 Box::new(ReplaceUnevaluatedProperties),
83 | |                 Box::new(RemoveRefSiblings),
84 | |                 Box::new(ReplacePrefixItems),
85 | |             ],
   | |_____________- in this macro invocation
   |
   = note: expected struct `alloc::boxed::Box<[alloc::boxed::Box<dyn GenTransform>]>`
              found struct `alloc::boxed::Box<[alloc::boxed::Box<transform::ReplaceUnevaluatedProperties>; 3]>`

error[E0308]: mismatched types
  --> /rustc-dev/b7ef2e79c55f923c682e262312c8400bbc00f402/library/alloc/src/macros.rs:62:21
   |
42 | macro_rules! vec {
   | ---------------- in this expansion of `vec!`
...
62 |                     b.assume_init()
   |                     ^^^^^^^^^^^^^^^ expected `Box<[Box<dyn GenTransform>]>`, found `Box<[Box<ReplacePrefixItems>; 1]>`
   |
  ::: /rust/deps/schemars-1.0.4/src/generate.rs:97:25
   |
97 |             transforms: vec![Box::new(ReplacePrefixItems)],
   |                         ---------------------------------- in this macro invocation
   |
   = note: expected struct `alloc::boxed::Box<[alloc::boxed::Box<dyn GenTransform>]>`
              found struct `alloc::boxed::Box<[alloc::boxed::Box<transform::ReplacePrefixItems>; 1]>`

error[E0308]: mismatched types
   --> /rust/deps/schemars-1.0.4/src/generate.rs:123:26
    |
123 |                   Box::new(ReplaceBoolSchemas {
    |  _________________--------_^
    | |                 |
    | |                 arguments to this function are incorrect
124 | |                     skip_additional_properties: true,
125 | |                 }),
    | |_________________^ expected `ReplaceUnevaluatedProperties`, found `ReplaceBoolSchemas`
    |
note: associated function defined here
   --> /rustc-dev/b7ef2e79c55f923c682e262312c8400bbc00f402/library/alloc/src/boxed.rs:261:12
    |
261 |     pub fn new(x: T) -> Self {
    |            ^^^

error[E0308]: mismatched types
   --> /rust/deps/schemars-1.0.4/src/generate.rs:126:26
    |
126 |                 Box::new(AddNullable::default()),
    |                 -------- ^^^^^^^^^^^^^^^^^^^^^^ expected `ReplaceUnevaluatedProperties`, found `AddNullable`
    |                 |
    |                 arguments to this function are incorrect
    |
note: associated function defined here
   --> /rustc-dev/b7ef2e79c55f923c682e262312c8400bbc00f402/library/alloc/src/boxed.rs:261:12
    |
261 |     pub fn new(x: T) -> Self {
    |            ^^^

error[E0308]: mismatched types
   --> /rust/deps/schemars-1.0.4/src/generate.rs:127:26
    |
127 |                 Box::new(RemoveRefSiblings),
    |                 -------- ^^^^^^^^^^^^^^^^^ expected `ReplaceUnevaluatedProperties`, found `RemoveRefSiblings`
    |                 |
    |                 arguments to this function are incorrect
    |
note: associated function defined here
   --> /rustc-dev/b7ef2e79c55f923c682e262312c8400bbc00f402/library/alloc/src/boxed.rs:261:12
    |
261 |     pub fn new(x: T) -> Self {
    |            ^^^

error[E0308]: mismatched types
   --> /rust/deps/schemars-1.0.4/src/generate.rs:128:26
    |
128 |                 Box::new(SetSingleExample),
    |                 -------- ^^^^^^^^^^^^^^^^ expected `ReplaceUnevaluatedProperties`, found `SetSingleExample`
    |                 |
    |                 arguments to this function are incorrect
    |
note: associated function defined here
   --> /rustc-dev/b7ef2e79c55f923c682e262312c8400bbc00f402/library/alloc/src/boxed.rs:261:12
    |
261 |     pub fn new(x: T) -> Self {
    |            ^^^

error[E0308]: mismatched types
   --> /rust/deps/schemars-1.0.4/src/generate.rs:129:26
    |
129 |                 Box::new(ReplaceConstValue),
    |                 -------- ^^^^^^^^^^^^^^^^^ expected `ReplaceUnevaluatedProperties`, found `ReplaceConstValue`
    |                 |
    |                 arguments to this function are incorrect
    |
note: associated function defined here
   --> /rustc-dev/b7ef2e79c55f923c682e262312c8400bbc00f402/library/alloc/src/boxed.rs:261:12
    |
261 |     pub fn new(x: T) -> Self {
    |            ^^^

error[E0308]: mismatched types
   --> /rust/deps/schemars-1.0.4/src/generate.rs:130:26
    |
130 |                 Box::new(ReplacePrefixItems),
    |                 -------- ^^^^^^^^^^^^^^^^^^ expected `ReplaceUnevaluatedProperties`, found `ReplacePrefixItems`
    |                 |
    |                 arguments to this function are incorrect
    |
note: associated function defined here
   --> /rustc-dev/b7ef2e79c55f923c682e262312c8400bbc00f402/library/alloc/src/boxed.rs:261:12
---
    |
 42 |   macro_rules! vec {
    |   ---------------- in this expansion of `vec!`
...
 62 |                       b.assume_init()
    |                       ^^^^^^^^^^^^^^^ expected `Box<[Box<dyn GenTransform>]>`, found `Box<[Box<...>; 7]>`
    |
   ::: /rust/deps/schemars-1.0.4/src/generate.rs:121:25
    |
121 |               transforms: vec![
    |  _________________________-
122 | |                 Box::new(ReplaceUnevaluatedProperties),
123 | |                 Box::new(ReplaceBoolSchemas {
124 | |                     skip_additional_properties: true,
...   |
130 | |                 Box::new(ReplacePrefixItems),
131 | |             ],
    | |_____________- in this macro invocation
    |
    = note: expected struct `alloc::boxed::Box<[alloc::boxed::Box<dyn GenTransform>]>`
               found struct `alloc::boxed::Box<[alloc::boxed::Box<transform::ReplaceUnevaluatedProperties>; 7]>`

[RUSTC-TIMING] gsgdt test:false 2.016
   Compiling rustc_baked_icu_data v0.0.0 (/checkout/compiler/rustc_baked_icu_data)
[RUSTC-TIMING] rustc_data_structures test:false 3.322
[RUSTC-TIMING] fluent_bundle test:false 2.074
---
warning: rustc_llvm@0.0.0: Inherited flag "-fembed-bitcode=all" is not supported by the currently used CC
warning: rustc_llvm@0.0.0: Inherited flag "-fembed-bitcode=all" is not supported by the currently used CC
warning: rustc_llvm@0.0.0: Inherited flag "-fembed-bitcode=all" is not supported by the currently used CC
warning: rustc_llvm@0.0.0: Inherited flag "-fembed-bitcode=all" is not supported by the currently used CC
Bootstrap failed while executing `build --target x86_64-unknown-linux-gnu --host x86_64-unknown-linux-gnu --stage 2 library/std --set rust.llvm-bitcode-linker=false --set build.extended=false --set rust.codegen-backends=['llvm'] --set rust.deny-warnings=false --rust-profile-generate /tmp/tmp-multistage/opt-artifacts/rustc-pgo --set llvm.thin-lto=false --set llvm.link-shared=true`
Build completed unsuccessfully in 0:10:53
[2025-10-20T13:31:31.839Z INFO  opt_dist::timer] Section `Stage 1 (Rustc PGO) > Build PGO instrumented rustc and LLVM` ended: FAIL (653.92s)`
[2025-10-20T13:31:31.839Z INFO  opt_dist::timer] Section `Stage 1 (Rustc PGO)` ended: FAIL (653.92s)`
[2025-10-20T13:31:31.839Z INFO  opt_dist] Timer results
    -----------------------------------------------------------------
---
[2025-10-20T13:31:31.839Z INFO  opt_dist::utils] Free disk space: 1.25 TiB out of total 2.18 TiB (42.81% used)
Error: Optimized build pipeline has failed

Caused by:
    Command RUST_BACKTRACE=full python3 /checkout/x.py build --target x86_64-unknown-linux-gnu --host x86_64-unknown-linux-gnu --stage 2 library/std --set rust.llvm-bitcode-linker=false --set build.extended=false --set rust.codegen-backends=['llvm'] --set rust.deny-warnings=false --rust-profile-generate /tmp/tmp-multistage/opt-artifacts/rustc-pgo --set llvm.thin-lto=false --set llvm.link-shared=true [at /checkout/obj] has failed with exit code Some(1)

Stack backtrace:
   0: <anyhow::Error>::msg::<alloc::string::String>
             at /rust/deps/anyhow-1.0.99/src/backtrace.rs:27:14
   1: <opt_dist::exec::CmdBuilder>::run
             at /rustc/b7ef2e79c55f923c682e262312c8400bbc00f402/src/tools/opt-dist/src/exec.rs:80:17
   2: <opt_dist::exec::Bootstrap>::run
             at /rustc/b7ef2e79c55f923c682e262312c8400bbc00f402/src/tools/opt-dist/src/exec.rs:199:18
   3: opt_dist::execute_pipeline::{closure#1}::{closure#0}
             at /rustc/b7ef2e79c55f923c682e262312c8400bbc00f402/src/tools/opt-dist/src/main.rs:256:21
   4: <opt_dist::timer::TimerSection>::section::<opt_dist::execute_pipeline::{closure#1}::{closure#0}, ()>
             at /rustc/b7ef2e79c55f923c682e262312c8400bbc00f402/src/tools/opt-dist/src/timer.rs:111:22
   5: opt_dist::execute_pipeline::{closure#1}
             at /rustc/b7ef2e79c55f923c682e262312c8400bbc00f402/src/tools/opt-dist/src/main.rs:245:15
   6: <opt_dist::timer::TimerSection>::section::<opt_dist::execute_pipeline::{closure#1}, opt_dist::training::RustcPGOProfile>
             at /rustc/b7ef2e79c55f923c682e262312c8400bbc00f402/src/tools/opt-dist/src/timer.rs:111:22
   7: opt_dist::execute_pipeline
             at /rustc/b7ef2e79c55f923c682e262312c8400bbc00f402/src/tools/opt-dist/src/main.rs:242:35
   8: opt_dist::main
             at /rustc/b7ef2e79c55f923c682e262312c8400bbc00f402/src/tools/opt-dist/src/main.rs:467:18
   9: <fn() -> core::result::Result<(), anyhow::Error> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/bb624dcb4c8ab987e10c0808d92d76f3b84dd117/library/core/src/ops/function.rs:250:5
  10: std::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core::result::Result<(), anyhow::Error>, core::result::Result<(), anyhow::Error>>
             at /rustc/bb624dcb4c8ab987e10c0808d92d76f3b84dd117/library/std/src/sys/backtrace.rs:158:18
  11: std::rt::lang_start::<core::result::Result<(), anyhow::Error>>::{closure#0}
             at /rustc/bb624dcb4c8ab987e10c0808d92d76f3b84dd117/library/std/src/rt.rs:206:18
  12: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/bb624dcb4c8ab987e10c0808d92d76f3b84dd117/library/core/src/ops/function.rs:287:21
  13: std::panicking::catch_unwind::do_call
             at /rustc/bb624dcb4c8ab987e10c0808d92d76f3b84dd117/library/std/src/panicking.rs:590:40
  14: std::panicking::catch_unwind
             at /rustc/bb624dcb4c8ab987e10c0808d92d76f3b84dd117/library/std/src/panicking.rs:553:19

@RalfJung
Copy link
Member Author

@bors try

@rust-bors
Copy link

rust-bors bot commented Oct 20, 2025

⌛ Trying commit 3c2d199 with merge 23a3fb3

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/18654215198

rust-bors bot added a commit that referenced this pull request Oct 20, 2025
perf experiment: try to replace box_new with write_via_move
@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)
diff of stderr:

2   --> $DIR/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:12:9
3    |
4 LL |     let y = vec![format!("World")];
-    |         - captured outer variable
+    |         -   ---------------------- move occurs because `y` has type `Vec<String>`, which does not implement the `Copy` trait
+    |         |
+    |         captured outer variable
6 LL |     call(|| {
7    |          -- captured by this `Fn` closure
8 LL |         y.into_iter();

9    |         ^ ----------- `y` moved due to this method call
10    |         |
-    |         move occurs because `y` has type `Vec<String>`, which does not implement the `Copy` trait
+    |         `y` is moved here
12    |
13 help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
14   --> $DIR/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:5:28


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.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/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.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/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure" "-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[E0507]: cannot move out of `y`, a captured variable in an `Fn` closure
##[error]  --> /checkout/tests/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:12:9
   |
LL |     let y = vec![format!("World")];
   |         -   ---------------------- move occurs because `y` has type `Vec<String>`, which does not implement the `Copy` trait
   |         |
   |         captured outer variable
LL |     call(|| {
   |          -- captured by this `Fn` closure
LL |         y.into_iter();
   |         ^ ----------- `y` moved due to this method call
   |         |
   |         `y` is moved here
   |
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
  --> /checkout/tests/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:5:28
   |
LL | fn call<F>(f: F) where F : Fn() {
   |                            ^^^^
note: `into_iter` takes ownership of the receiver `self`, which moves `y`
  --> /rustc/FAKE_PREFIX/library/core/src/iter/traits/collect.rs:310:18
help: you can `clone` the value and consume it, but this might not be your desired behavior
   |
LL |         <Vec<String> as Clone>::clone(&y).into_iter();
   |         +++++++++++++++++++++++++++++++ +
help: consider cloning the value if the performance cost is acceptable
   |
LL |         y.clone().into_iter();
   |          ++++++++

---
To only update this specific test, also pass `--test-args consts/min_const_fn/bad_const_fn_body_ice.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/consts/min_const_fn/bad_const_fn_body_ice.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/consts/min_const_fn/bad_const_fn_body_ice" "-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[E0015]: cannot call non-const associated function `Box::<[i32; 3]>::new` in constant functions
##[error]  --> /checkout/tests/ui/consts/min_const_fn/bad_const_fn_body_ice.rs:2:5
   |
---
-   --> $DIR/issue-105084.rs:38:14
+ error[E0425]: cannot find function `box_new` in module `std::boxed`
+   --> $DIR/issue-105084.rs:22:29
3    |
- LL |     let mut g = #[coroutine]
-    |         ----- move occurs because `g` has type `{coroutine@$DIR/issue-105084.rs:16:5: 16:7}`, which does not implement the `Copy` trait
- ...
- LL |     let mut h = copy(g);
-    |                      - value moved here
- ...
- LL |     Pin::new(&mut g).resume(());
-    |              ^^^^^^ value borrowed here after move
-    |
- note: consider changing this parameter type in function `copy` to borrow instead if owning the value isn't necessary
-   --> $DIR/issue-105084.rs:10:21
-    |
- LL | fn copy<T: Copy>(x: T) -> T {
-    |    ----             ^ this parameter takes ownership of the value
-    |    |
-    |    in this function
- help: consider cloning the value if the performance cost is acceptable
-    |
- LL |     let mut h = copy(g.clone());
-    |                       ++++++++
- 
- error[E0277]: the trait bound `Box<(i32, ())>: Copy` is not satisfied in `{coroutine@$DIR/issue-105084.rs:16:5: 16:7}`
-   --> $DIR/issue-105084.rs:32:17
-    |
- LL |     || {
-    |     -- within this `{coroutine@$DIR/issue-105084.rs:16:5: 16:7}`
- ...
- LL |     let mut h = copy(g);
-    |                 ^^^^^^^ within `{coroutine@$DIR/issue-105084.rs:16:5: 16:7}`, the trait `Copy` is not implemented for `Box<(i32, ())>`
-    |
- note: coroutine does not implement `Copy` as this value is used across a yield
-   --> $DIR/issue-105084.rs:22:41
-    |
37 LL |         let t = std::boxed::box_new((5, yield));
-    |                 ------------------------^^^^^--
-    |                 |                       |
-    |                 |                       yield occurs here, with `std::boxed::box_new((5, yield))` maybe used later
-    |                 has type `Box<(i32, ())>` which does not implement `Copy`
- note: required by a bound in `copy`
-   --> $DIR/issue-105084.rs:10:12
-    |
- LL | fn copy<T: Copy>(x: T) -> T {
-    |            ^^^^ required by this bound in `copy`
+    |                             ^^^^^^^ not found in `std::boxed`
47 
- error: aborting due to 2 previous errors
+ error: aborting due to 1 previous error
---
To only update this specific test, also pass `--test-args coroutine/issue-105084.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/coroutine/issue-105084.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/coroutine/issue-105084" "-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" "--diagnostic-width=300"
stdout: none
--- stderr -------------------------------
error[E0425]: cannot find function `box_new` in module `std::boxed`
##[error]  --> /checkout/tests/ui/coroutine/issue-105084.rs:22:29
   |
LL |         let t = std::boxed::box_new((5, yield));
   |                             ^^^^^^^ not found in `std::boxed`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0425`.
------------------------------------------
---
- error[E0010]: allocations are not allowed in constants
+ error[E0015]: cannot call non-const associated function `Box::<[i32; 3]>::new` in constants
2   --> $DIR/E0010-teach.rs:5:23
3    |
4 LL | const CON: Vec<i32> = vec![1, 2, 3];

-    |                       ^^^^^^^^^^^^^ allocation not allowed in constants
+    |                       ^^^^^^^^^^^^^
6    |
-    = note: The runtime heap is not yet available at compile-time, so no runtime heap allocations can be created.
---
To only update this specific test, also pass `--test-args error-codes/E0010-teach.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/error-codes/E0010-teach.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/error-codes/E0010-teach" "-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" "-Z" "teach"
stdout: none
--- stderr -------------------------------
error[E0015]: cannot call non-const associated function `Box::<[i32; 3]>::new` in constants
##[error]  --> /checkout/tests/ui/error-codes/E0010-teach.rs:5:23
   |
LL | const CON: Vec<i32> = vec![1, 2, 3]; //~ ERROR E0010
   |                       ^^^^^^^^^^^^^
   |
   = note: calls in constants are limited to constant functions, tuple structs and tuple variants
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const method `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constants
##[error]  --> /checkout/tests/ui/error-codes/E0010-teach.rs:5:23
   |
LL | const CON: Vec<i32> = vec![1, 2, 3]; //~ ERROR E0010
   |                       ^^^^^^^^^^^^^
   |
   = note: calls in constants are limited to constant functions, tuple structs and tuple variants
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

---
- error[E0010]: allocations are not allowed in constants
+ error[E0015]: cannot call non-const associated function `Box::<[i32; 3]>::new` in constants
2   --> $DIR/E0010.rs:3:23
3    |
4 LL | const CON: Vec<i32> = vec![1, 2, 3];

-    |                       ^^^^^^^^^^^^^ allocation not allowed in constants
+    |                       ^^^^^^^^^^^^^
6    |
+    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
---
To only update this specific test, also pass `--test-args error-codes/E0010.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/error-codes/E0010.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/error-codes/E0010" "-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[E0015]: cannot call non-const associated function `Box::<[i32; 3]>::new` in constants
##[error]  --> /checkout/tests/ui/error-codes/E0010.rs:3:23
   |
LL | const CON: Vec<i32> = vec![1, 2, 3]; //~ ERROR E0010
   |                       ^^^^^^^^^^^^^
   |
   = note: calls in constants are limited to constant functions, tuple structs and tuple variants
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const method `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constants
##[error]  --> /checkout/tests/ui/error-codes/E0010.rs:3:23
   |
LL | const CON: Vec<i32> = vec![1, 2, 3]; //~ ERROR E0010
   |                       ^^^^^^^^^^^^^
   |
   = note: calls in constants are limited to constant functions, tuple structs and tuple variants
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

---
---- [ui] tests/ui/limits/issue-17913.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/limits/issue-17913/issue-17913.stderr`
diff of stderr:

- error: values of the type `[&usize; usize::MAX]` are too big for the target architecture
+ error[E0080]: values of the type `[&usize; usize::MAX]` are too big for the target architecture
+   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+    |
+    = note: evaluation of `<[&usize; usize::MAX] as std::mem::SizedTypeProperties>::IS_ZST` failed inside this call
+ note: inside `std::mem::size_of::<[&usize; usize::MAX]>`
+   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ 
+ error[E0080]: values of the type `[&usize; usize::MAX]` are too big for the target architecture
+   --> $SRC_DIR/core/src/ptr/alignment.rs:LL:COL
+    |
+    = note: evaluation of `std::ptr::Alignment::of::<std::mem::MaybeUninit<[&usize; usize::MAX]>>::{constant#0}` failed inside this call
+ note: inside `std::mem::align_of::<MaybeUninit<[&usize; usize::MAX]>>`
+   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ 
+ note: the above error was encountered while instantiating `fn Box::<[&usize; usize::MAX]>::try_new_uninit_in`
2   --> $SRC_DIR/alloc/src/boxed.rs:LL:COL
3 
- error: aborting due to 1 previous error
+ error: aborting due to 2 previous errors
5 
+ For more information about this error, try `rustc --explain E0080`.
6 

Note: some mismatched output was normalized before being compared
- error[E0080]: values of the type `[&usize; 17293822569102704640]` are too big for the target architecture
-   --> /rustc/FAKE_PREFIX/library/core/src/mem/mod.rs:1266:26
-    = note: evaluation of `<[&usize; 17293822569102704640] as std::mem::SizedTypeProperties>::IS_ZST` failed inside this call
- note: inside `std::mem::size_of::<[&usize; 17293822569102704640]>`
-   --> /rustc/FAKE_PREFIX/library/core/src/mem/mod.rs:336:5
- error[E0080]: values of the type `[&usize; 17293822569102704640]` are too big for the target architecture
-   --> /rustc/FAKE_PREFIX/library/core/src/ptr/alignment.rs:50:32
-    = note: evaluation of `std::ptr::Alignment::of::<std::mem::MaybeUninit<[&usize; 17293822569102704640]>>::{constant#0}` failed inside this call
- note: inside `std::mem::align_of::<MaybeUninit<[&usize; 17293822569102704640]>>`
-   --> /rustc/FAKE_PREFIX/library/core/src/mem/mod.rs:491:5
- note: the above error was encountered while instantiating `fn Box::<[&usize; 17293822569102704640]>::try_new_uninit_in`
-   --> /rustc/FAKE_PREFIX/library/alloc/src/boxed.rs:475:15
+ error[E0080]: values of the type `[&usize; usize::MAX]` are too big for the target architecture
+   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+    |
+    = note: evaluation of `<[&usize; usize::MAX] as std::mem::SizedTypeProperties>::IS_ZST` failed inside this call
+ note: inside `std::mem::size_of::<[&usize; usize::MAX]>`
+   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ 
+ error[E0080]: values of the type `[&usize; usize::MAX]` are too big for the target architecture
+   --> $SRC_DIR/core/src/ptr/alignment.rs:LL:COL
+    |
+    = note: evaluation of `std::ptr::Alignment::of::<std::mem::MaybeUninit<[&usize; usize::MAX]>>::{constant#0}` failed inside this call
+ note: inside `std::mem::align_of::<MaybeUninit<[&usize; usize::MAX]>>`
+   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ 
+ note: the above error was encountered while instantiating `fn Box::<[&usize; usize::MAX]>::try_new_uninit_in`
+ error: aborting due to 2 previous errors
+ For more information about this error, try `rustc --explain E0080`.


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args limits/issue-17913.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/limits/issue-17913.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" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/limits/issue-17913" "-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[E0080]: values of the type `[&usize; 17293822569102704640]` are too big for the target architecture
##[error]  --> /rustc/FAKE_PREFIX/library/core/src/mem/mod.rs:1266:26
   |
   = note: evaluation of `<[&usize; 17293822569102704640] as std::mem::SizedTypeProperties>::IS_ZST` failed inside this call
note: inside `std::mem::size_of::<[&usize; 17293822569102704640]>`
  --> /rustc/FAKE_PREFIX/library/core/src/mem/mod.rs:336:5

error[E0080]: values of the type `[&usize; 17293822569102704640]` are too big for the target architecture
##[error]  --> /rustc/FAKE_PREFIX/library/core/src/ptr/alignment.rs:50:32
   |
   = note: evaluation of `std::ptr::Alignment::of::<std::mem::MaybeUninit<[&usize; 17293822569102704640]>>::{constant#0}` failed inside this call
note: inside `std::mem::align_of::<MaybeUninit<[&usize; 17293822569102704640]>>`
  --> /rustc/FAKE_PREFIX/library/core/src/mem/mod.rs:491:5

note: the above error was encountered while instantiating `fn Box::<[&usize; 17293822569102704640]>::try_new_uninit_in`
  --> /rustc/FAKE_PREFIX/library/alloc/src/boxed.rs:475:15

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0080`.
---
34 

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/macros/vec-macro-in-pattern.rs:7:14
- LL |         Some(vec![43]) => {} //~ ERROR expected a pattern, found a function call
+ error[E0164]: expected tuple struct or tuple variant, found associated function `::alloc::boxed::Box::new`
+   --> $DIR/vec-macro-in-pattern.rs:7:14
+    |
+ LL |         Some(vec![43]) => {}
+    |              ^^^^^^^^ `fn` calls are not allowed in patterns
+    |
---
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[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[E0164]: expected tuple struct or tuple variant, found associated function `::alloc::boxed::Box::new`
##[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
---
11 LL |   };
12    |   - value is dropped here
13 
- error[E0010]: allocations are not allowed in statics
+ error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
15   --> $DIR/check-values-constraints.rs:81:33
16    |
17 LL | static STATIC11: Vec<MyOwned> = vec![MyOwned];

-    |                                 ^^^^^^^^^^^^^ allocation not allowed in statics
+    |                                 ^^^^^^^^^^^^^
19    |
+    = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
20    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
21 
22 error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics

38    = note: calls in statics are limited to constant functions, tuple structs and tuple variants
39    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
40 
- error[E0010]: allocations are not allowed in statics
+ error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
42   --> $DIR/check-values-constraints.rs:96:5
43    |
44 LL |     vec![MyOwned],

-    |     ^^^^^^^^^^^^^ allocation not allowed in statics
+    |     ^^^^^^^^^^^^^
46    |
+    = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
47    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
48 
49 error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics

56    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
57    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
58 
- error[E0010]: allocations are not allowed in statics
+ error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
60   --> $DIR/check-values-constraints.rs:98:5
61    |
62 LL |     vec![MyOwned],

-    |     ^^^^^^^^^^^^^ allocation not allowed in statics
+    |     ^^^^^^^^^^^^^
64    |
+    = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
65    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
66 
67 error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics

74    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
75    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
76 
- error[E0010]: allocations are not allowed in statics
+ error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
78   --> $DIR/check-values-constraints.rs:103:6
79    |
80 LL |     &vec![MyOwned],

-    |      ^^^^^^^^^^^^^ allocation not allowed in statics
+    |      ^^^^^^^^^^^^^
82    |
+    = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
83    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
84 
85 error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics

92    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
93    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
94 
- error[E0010]: allocations are not allowed in statics
+ error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
96   --> $DIR/check-values-constraints.rs:105:6
97    |
98 LL |     &vec![MyOwned],

-    |      ^^^^^^^^^^^^^ allocation not allowed in statics
+    |      ^^^^^^^^^^^^^
100    |
+    = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
101    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
102 
103 error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics

110    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
111    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
112 
- error[E0010]: allocations are not allowed in statics
+ error[E0015]: cannot call non-const associated function `Box::<[isize; 1]>::new` in statics
114   --> $DIR/check-values-constraints.rs:111:31
115    |
116 LL | static STATIC19: Vec<isize> = vec![3];

-    |                               ^^^^^^^ allocation not allowed in statics
+    |                               ^^^^^^^
118    |
+    = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
119    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
120 
121 error[E0015]: cannot call non-const method `slice::<impl [isize]>::into_vec::<std::alloc::Global>` in statics

128    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
129    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
130 
- error[E0010]: allocations are not allowed in statics
+ error[E0015]: cannot call non-const associated function `Box::<[isize; 1]>::new` in statics
132   --> $DIR/check-values-constraints.rs:117:32
133    |
134 LL |         static x: Vec<isize> = vec![3];

-    |                                ^^^^^^^ allocation not allowed in statics
+    |                                ^^^^^^^
136    |
+    = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+    = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
137    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
138 
139 error[E0015]: cannot call non-const method `slice::<impl [isize]>::into_vec::<std::alloc::Global>` in statics

163 
164 error: aborting due to 17 previous errors
165 
- Some errors have detailed explanations: E0010, E0015, E0493, E0507.
---
To only update this specific test, also pass `--test-args statics/check-values-constraints.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/statics/check-values-constraints.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/statics/check-values-constraints" "-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[E0493]: destructor of `SafeStruct` cannot be evaluated at compile-time
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:64:7
   |
LL |       ..SafeStruct {
   |  _______^
LL | |         //~^ ERROR destructor of
LL | |         field1: SafeEnum::Variant3(WithDtor),
LL | |         field2: SafeEnum::Variant1,
LL | |     }
   | |_____^ the destructor for this type cannot be evaluated in statics
LL |   };
   |   - value is dropped here

error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:81:33
   |
LL | static STATIC11: Vec<MyOwned> = vec![MyOwned];
   |                                 ^^^^^^^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:81:33
   |
LL | static STATIC11: Vec<MyOwned> = vec![MyOwned];
   |                                 ^^^^^^^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const method `<str as ToString>::to_string` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:92:38
   |
LL |     field2: SafeEnum::Variant4("str".to_string()), //~ ERROR cannot call non-const method
   |                                      ^^^^^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`

error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:96:5
   |
LL |     vec![MyOwned], //~ ERROR allocations are not allowed in statics
   |     ^^^^^^^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:96:5
   |
LL |     vec![MyOwned], //~ ERROR allocations are not allowed in statics
   |     ^^^^^^^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:98:5
   |
LL |     vec![MyOwned], //~ ERROR allocations are not allowed in statics
   |     ^^^^^^^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:98:5
   |
LL |     vec![MyOwned], //~ ERROR allocations are not allowed in statics
   |     ^^^^^^^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:103:6
   |
LL |     &vec![MyOwned], //~ ERROR allocations are not allowed in statics
   |      ^^^^^^^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:103:6
   |
LL |     &vec![MyOwned], //~ ERROR allocations are not allowed in statics
   |      ^^^^^^^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const associated function `Box::<[MyOwned; 1]>::new` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:105:6
   |
LL |     &vec![MyOwned], //~ ERROR allocations are not allowed in statics
   |      ^^^^^^^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const method `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:105:6
   |
LL |     &vec![MyOwned], //~ ERROR allocations are not allowed in statics
   |      ^^^^^^^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const associated function `Box::<[isize; 1]>::new` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:111:31
   |
LL | static STATIC19: Vec<isize> = vec![3];
   |                               ^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const method `slice::<impl [isize]>::into_vec::<std::alloc::Global>` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:111:31
   |
LL | static STATIC19: Vec<isize> = vec![3];
   |                               ^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const associated function `Box::<[isize; 1]>::new` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:117:32
   |
LL |         static x: Vec<isize> = vec![3]; //~ ERROR allocations are not allowed in statics
   |                                ^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const method `slice::<impl [isize]>::into_vec::<std::alloc::Global>` in statics
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:117:32
   |
LL |         static x: Vec<isize> = vec![3]; //~ ERROR allocations are not allowed in statics
   |                                ^^^^^^^
   |
   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
   = note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of static item `x`
##[error]  --> /checkout/tests/ui/statics/check-values-constraints.rs:119:9
   |
LL |         x
   |         ^ move occurs because `x` has type `Vec<isize>`, which does not implement the `Copy` trait
   |
help: consider borrowing here
   |
LL |         &x
   |         +
---
---- [ui] tests/ui/unpretty/box.rs stdout ----

error: test compilation failed although it shouldn't!
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/unpretty/box.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/unpretty/box" "-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" "-Zunpretty=thir-tree"
stdout: none
--- stderr -------------------------------
error[E0425]: cannot find function `box_new` in module `std::boxed`
##[error]  --> /checkout/tests/ui/unpretty/box.rs:7:25
   |

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

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-perf Status: Waiting on a perf run to be completed. 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