]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/issue-67945-1.rs
Rollup merge of #80382 - GuillaumeGomez:search-result-tab-picking, r=Nemo157,pickfire
[rust.git] / src / test / ui / const-generics / issue-67945-1.rs
1 // revisions: full min
2
3 #![cfg_attr(full, allow(incomplete_features))]
4 #![cfg_attr(full, feature(const_generics))]
5
6 use std::marker::PhantomData;
7
8 use std::mem::{self, MaybeUninit};
9
10 struct Bug<S> {
11     //~^ ERROR parameter `S` is never used
12     A: [(); {
13         let x: S = MaybeUninit::uninit();
14         //[min]~^ ERROR generic parameters may not be used in const operations
15         //[full]~^^ ERROR mismatched types
16         let b = &*(&x as *const _ as *const S);
17         //[min]~^ ERROR generic parameters may not be used in const operations
18         0
19     }],
20 }
21
22 fn main() {}