Skip to content

Commit 2b3884f

Browse files
authored
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```
2 parents 5b78e6d + d7e0f43 commit 2b3884f

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

src/test/ui/const-generics/min_const_generics/transmute-const-param-static-reference.rs

-10
This file was deleted.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `&'static ()` is forbidden as the type of a const generic parameter
2-
--> $DIR/transmute-const-param-static-reference.rs:1:23
2+
--> $DIR/transmute-const-param-static-reference.rs:7:23
33
|
44
LL | struct Const<const P: &'static ()>;
55
| ^^^^^^^^^^^
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// revisions: full min
2+
//[full] check-pass
3+
4+
#![cfg_attr(full, feature(const_generics))]
5+
#![cfg_attr(full, allow(incomplete_features))]
6+
7+
struct Const<const P: &'static ()>;
8+
//[min]~^ ERROR `&'static ()` is forbidden as the type of a const generic parameter
9+
10+
fn main() {
11+
const A: &'static () = unsafe {
12+
std::mem::transmute(10 as *const ())
13+
};
14+
15+
let _ = Const::<{A}>;
16+
}

0 commit comments

Comments
 (0)