mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-13 23:42:56 +00:00
Run full const-generics test for issue-72293
This commit is contained in:
parent
c622840b90
commit
d7e0f431de
@ -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}>;
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
error: `&'static ()` is forbidden as the type of a const generic parameter
|
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 ()>;
|
LL | struct Const<const P: &'static ()>;
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^
|
@ -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}>;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user