Skip to content

Commit

Permalink
Run full const-generics test for issue-72293
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Jun 10, 2021
1 parent c622840 commit d7e0f43
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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 ()>;
| ^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -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}>;
}

0 comments on commit d7e0f43

Please sign in to comment.