rust/tests/ui/generic-const-items/def-site-eval.rs
León Orell Valerian Liehr a83f8d02ea
Always evaluate free lifetime-generic constants
Co-authored-by: Michael Goulet <michael@errs.io>
2025-05-27 18:58:51 +02:00

16 lines
419 B
Rust

//! Test that we only evaluate free const items (their def site to be clear)
//! whose generics don't require monomorphization.
#![feature(generic_const_items)]
#![expect(incomplete_features)]
//@ revisions: fail pass
//@[pass] check-pass
const _<_T>: () = panic!();
const _<const _N: usize>: () = panic!();
#[cfg(fail)]
const _<'_a>: () = panic!(); //[fail]~ ERROR evaluation of constant value failed
fn main() {}