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