1 // This was originally a regression test for #66975 - ensure that we do not generate never typed
2 // consts in codegen. We also have tests for this that catches the error, see
3 // src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs.
5 // Force generation of optimized mir for functions that do not reach codegen.
6 // compile-flags: --emit mir,link
8 #![feature(never_type)]
11 struct PrintName<T>(T);
13 impl<T> PrintName<T> {
14 const VOID: ! = panic!();
17 // EMIT_MIR remove_never_const.no_codegen.PreCodegen.after.mir
19 let _ = PrintName::<T>::VOID;