Files
rust/tests/mir-opt/remove_never_const.rs
T
Zalathar 58f8739d55 Migrate mir-opt tests from PreCodegen to runtime-optimized
MIR dumped before/after the dummy `PreCodegen` pass should be identical to MIR
dumped after the phase transition to `runtime-optimized`.
2026-05-13 15:40:23 +10:00

20 lines
507 B
Rust

//@ skip-filecheck
// This was originally a regression test for #66975 - ensure that we do not generate never typed
// consts in codegen. We also have tests for this that catches the error, see
// tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs.
#![feature(never_type)]
struct PrintName<T>(T);
impl<T> PrintName<T> {
const VOID: ! = panic!();
}
// EMIT_MIR remove_never_const.no_codegen.runtime-optimized.after.mir
fn no_codegen<T>() {
let _ = PrintName::<T>::VOID;
}
fn main() {}