]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-unsized.rs
Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthewjasper
[rust.git] / src / test / ui / consts / const-unsized.rs
1 use std::fmt::Debug;
2
3 const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync));
4 //~^ ERROR the size for values of type
5
6 const CONST_FOO: str = *"foo";
7 //~^ ERROR the size for values of type
8
9 static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync));
10 //~^ ERROR the size for values of type
11
12 static STATIC_BAR: str = *"bar";
13 //~^ ERROR the size for values of type
14
15 fn main() {
16     println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR);
17 }