]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/size-of-t.rs
Add 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a9d466af9eb613bb'
[rust.git] / src / test / 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() {}