Skip to content

Commit

Permalink
Rollup merge of rust-lang#86205 - JohnTitor:full-test-for-72293, r=ol…
Browse files Browse the repository at this point in the history
…i-obk

Run full const-generics test for issue-72293

Closes rust-lang#72293
r? `@oli-obk`
  • Loading branch information
Dylan-DPC authored Jun 11, 2021
2 parents 19bbc39 + d7e0f43 commit b3f2a37
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 b3f2a37

Please sign in to comment.