1
Fork 0

Split part of adt_const_params into unsized_const_params

This commit is contained in:
Boxy 2024-07-14 13:38:51 +01:00 committed by Boxy
parent 42cc42b942
commit d0c11bf6e3
140 changed files with 1130 additions and 559 deletions

View file

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