Static rustc_lint::builtin::CONST_EVALUATABLE_UNCHECKED

source ·
pub static CONST_EVALUATABLE_UNCHECKED: &'static Lint
Expand description

The const_evaluatable_unchecked lint detects a generic constant used in a type.


const fn foo<T>() -> usize {
    if std::mem::size_of::<*mut T>() < 8 { // size of *mut T does not depend on T
    } else {

fn test<T>() {
    let _ = [0; foo::<T>()];



In the 1.43 release, some uses of generic parameters in array repeat expressions were accidentally allowed. This is a future-incompatible lint to transition this to a hard error in the future. See issue #76200 for a more detailed description and possible fixes.