rust/tests/ui/const-generics/issues/issue-67945-1.rs
2024-02-16 20:02:50 +00:00

20 lines
552 B
Rust

//@ revisions: full min
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(full, feature(generic_const_exprs))]
use std::mem::MaybeUninit;
struct Bug<S> {
//[min]~^ 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() {}