about summary refs log tree commit diff
path: root/src/test/ui/const-generics/issue-67945-1.rs
blob: 84737e4e9857839380f0b6569e9ca132027e0860 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// revisions: full min

#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(full, feature(const_generics))]

use std::marker::PhantomData;

use std::mem::{self, MaybeUninit};

struct Bug<S> {
    //~^ ERROR parameter `S` is never used
    A: [(); {
        let x: S = MaybeUninit::uninit();
        //[min]~^ ERROR generic parameters may not be used in const operations
        //[full]~^^ ERROR mismatched types
        let b = &*(&x as *const _ as *const S);
        //[min]~^ ERROR generic parameters may not be used in const operations
        0
    }],
}

fn main() {}