]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-eval/size-of-t.rs
Bless and update consts tests
[rust.git] / tests / ui / consts / const-eval / size-of-t.rs
1 // https://github.com/rust-lang/rust/issues/69228
2 // Used to give bogus suggestion about T not being Sized.
3
4 use std::mem::size_of;
5
6 fn foo<T>() {
7     let _arr: [u8; size_of::<T>()];
8     //~^ ERROR generic parameters may not be used in const operations
9     //~| NOTE cannot perform const operation
10     //~| NOTE type parameters may not be used in const expressions
11 }
12
13 fn main() {}