rust/tests/ui/const-generics/issues/issue-67945-1.rs

20 lines
551 B
Rust
Raw Normal View History

2020-10-03 11:00:18 -05:00
// revisions: full min
#![cfg_attr(full, allow(incomplete_features))]
#![cfg_attr(full, feature(generic_const_exprs))]
use std::mem::MaybeUninit;
struct Bug<S> {
2021-10-12 15:47:34 -05:00
//[min]~^ ERROR parameter `S` is never used
A: [(); {
let x: S = MaybeUninit::uninit();
2020-10-12 16:27:59 -05:00
//[min]~^ ERROR generic parameters may not be used in const operations
2020-10-03 11:00:18 -05:00
//[full]~^^ ERROR mismatched types
let b = &*(&x as *const _ as *const S);
2020-10-12 16:27:59 -05:00
//[min]~^ ERROR generic parameters may not be used in const operations
0
}],
}
fn main() {}