//@ check-pass //@ compile-flags: -Zdeduplicate-diagnostics=yes #![allow(dead_code)] fn foo() { [0; std::mem::size_of::<*mut T>()]; //~^ WARN cannot use constants which depend on generic parameters in types //~| WARN this was previously accepted by the compiler but is being phased out } struct Foo(T); impl Foo { const ASSOC: usize = 4; fn test() { let _ = [0; Self::ASSOC]; //~^ WARN cannot use constants which depend on generic parameters in types //~| WARN this was previously accepted by the compiler but is being phased out } } struct Bar; impl Bar { const ASSOC: usize = 4; fn test() { let _ = [0; Self::ASSOC]; //~^ WARN cannot use constants which depend on generic parameters in types //~| WARN this was previously accepted by the compiler but is being phased out } } fn main() {}