Run full const-generics test for issue-72293

This commit is contained in:
Yuki Okushi 2021-06-11 06:20:54 +09:00
parent c622840b90
commit d7e0f431de
3 changed files with 17 additions and 11 deletions

View File

@ -1,10 +0,0 @@
struct Const<const P: &'static ()>;
//~^ ERROR `&'static ()` is forbidden as the type of a const generic parameter
fn main() {
const A: &'static () = unsafe {
std::mem::transmute(10 as *const ())
};
let _ = Const::<{A}>;
}

View File

@ -1,5 +1,5 @@
error: `&'static ()` is forbidden as the type of a const generic parameter
--> $DIR/transmute-const-param-static-reference.rs:1:23
--> $DIR/transmute-const-param-static-reference.rs:7:23
|
LL | struct Const<const P: &'static ()>;
| ^^^^^^^^^^^

View File

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