2024-07-14 12:38:51 +00:00
|
|
|
//@ revisions: full adt_const_params min
|
2021-06-10 21:20:54 +00:00
|
|
|
//@[full] check-pass
|
|
|
|
|
2024-07-14 12:38:51 +00:00
|
|
|
#![cfg_attr(full, feature(adt_const_params, unsized_const_params))]
|
2021-06-10 21:20:54 +00:00
|
|
|
#![cfg_attr(full, allow(incomplete_features))]
|
2024-07-14 12:38:51 +00:00
|
|
|
#![cfg_attr(adt_const_params, feature(adt_const_params))]
|
|
|
|
#![cfg_attr(adt_const_params, allow(incomplete_features))]
|
2021-06-10 21:20:54 +00:00
|
|
|
|
|
|
|
struct Const<const P: &'static ()>;
|
|
|
|
//[min]~^ ERROR `&'static ()` is forbidden as the type of a const generic parameter
|
2024-07-14 12:38:51 +00:00
|
|
|
//[adt_const_params]~^^ ERROR `&'static ()` can't be used as a const parameter type
|
2021-06-10 21:20:54 +00:00
|
|
|
|
|
|
|
fn main() {
|
2024-07-14 12:38:51 +00:00
|
|
|
const A: &'static () = unsafe { std::mem::transmute(10 as *const ()) };
|
2021-06-10 21:20:54 +00:00
|
|
|
|
2024-07-14 12:38:51 +00:00
|
|
|
let _ = Const::<{ A }>;
|
2021-06-10 21:20:54 +00:00
|
|
|
}
|