Rollup merge of #86205 - JohnTitor:full-test-for-72293, r=oli-obk
Run full const-generics test for issue-72293 Closes #72293 r? ```@oli-obk```
This commit is contained in:
commit
2b3884f6e6
3 changed files with 17 additions and 11 deletions
|
@ -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
|
||||
--> $DIR/transmute-const-param-static-reference.rs:1:23
|
||||
--> $DIR/transmute-const-param-static-reference.rs:7:23
|
||||
|
|
||||
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…
Add table
Add a link
Reference in a new issue