Change:
<ins> error[E0493]: destructors cannot be evaluated at compile-time --> $DIR/drop-elaboration-after-borrowck-error.rs:7:5 | LL |     a[0] = String::new(); |     ^^^^ |     | |     statics cannot evaluate destructors |     value is dropped here error[E0493]: destructors cannot be evaluated at compile-time --> $DIR/drop-elaboration-after-borrowck-error.rs:5:9 | LL |     let a: [String; 1]; |         ^ statics cannot evaluate destructors ... LL | }; | - value is dropped here error[E0381]: use of possibly-uninitialized variable: `a` --> $DIR/drop-elaboration-after-borrowck-error.rs:7:5 | LL |     a[0] = String::new(); |     ^^^^ use of possibly-uninitialized `a` error[E0493]: destructors cannot be evaluated at compile-time --> $DIR/drop-elaboration-after-borrowck-error.rs:18:9 | LL |         self.0[0] = other; |         ^^^^^^^^^ |         | |         constant functions cannot evaluate destructors |         value is dropped here error[E0493]: destructors cannot be evaluated at compile-time --> $DIR/drop-elaboration-after-borrowck-error.rs:16:13 | LL |         let _this = self; |             ^^^^^ constant functions cannot evaluate destructors ... LL |     } |     - value is dropped here error[E0382]: use of moved value: `self.0` --> $DIR/drop-elaboration-after-borrowck-error.rs:18:9 | LL |     pub const fn f(mut self, other: T) -> Self { |                    -------- move occurs because `self` has type `B<T>`, which does not implement the `Copy` trait LL |         let _this = self; |                     ---- value moved here LL | LL |         self.0[0] = other; |         ^^^^^^^^^ value used here after move error: aborting due to 6 previous errors Some errors have detailed explanations: E0381, E0382, E0493. For more information about an error, try `rustc --explain E0381`. </ins>

Discussion:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --The panic happens here <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
I can't seem to reproduce this locally, does it go away if you update your compiler?
Current compiler is: rustc 1.57.0 ( 2021-11-29) And the same happens when I use beta and nightly: beta: cargo 1.56.0-beta ( 2021-09-01) nightly: cargo 1.57.0-nightly ( 2021-09-18) I remembered I was using mold linker () but I switched to the default linker and the same happens, other then that my setup is normal
Actually I can confirm its reproducible, I just tried it with and the same thing happens maybe you didn't checkout the ice branch?
Ahhh, oops. Didn't notice it was on a different branch. Sorry, my bad! Yes, I can reproduce it fine locally.
MCVE: This code has move errors and fails const-checking, just like the original example. The ICE occurs after errors are emitted. did you truncate the logs in your original post? One option is to change the following statement to : For the non-const version, we abort before we ever get to drop elaboration due to the errors, though I'm not sure why.
For const items is queried earlier, without an intermediate exit point:
yes the error log is truncated, I have a move error

<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --ICE in illegal code in static block, rustc stable/beta/nightly. Found and reduced by <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: Also happens with <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
Assigning and removing as in the prioritization working group.