Skip to content

Commit d2830cb

Browse files
committed
Add tests (currently broken) for unsafe + inline const pat
1 parent 5c58a1b commit d2830cb

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// ignore-test This is currently broken
2+
// revisions: mir thir
3+
// [thir]compile-flags: -Z thir-unsafeck
4+
5+
#![allow(incomplete_features)]
6+
#![feature(inline_const_pat)]
7+
8+
const unsafe fn require_unsafe() -> usize { 1 }
9+
10+
fn main() {
11+
match () {
12+
const {
13+
require_unsafe();
14+
//~^ ERROR [E0133]
15+
} => (),
16+
}
17+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// ignore-test This is currently broken
2+
// check-pass
3+
// revisions: mir thir
4+
// [thir]compile-flags: -Z thir-unsafeck
5+
6+
#![allow(incomplete_features)]
7+
#![warn(unused_unsafe)]
8+
#![feature(inline_const_pat)]
9+
10+
const unsafe fn require_unsafe() -> usize { 1 }
11+
12+
fn main() {
13+
unsafe {
14+
match () {
15+
const {
16+
require_unsafe();
17+
unsafe {}
18+
//~^ WARNING unnecessary `unsafe` block
19+
} => (),
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)