Skip to content

Commit a5f0831

Browse files
Add check-pass test for #[unwind(aborts)] on a const fn
1 parent 98a2292 commit a5f0831

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/test/ui/consts/unwind-abort.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// check-pass
2+
3+
#![feature(unwind_attributes, const_panic)]
4+
5+
// `#[unwind(aborts)]` is okay for a `const fn`. We don't unwind in const-eval anyways.
6+
#[unwind(aborts)]
7+
const fn foo() {
8+
panic!()
9+
}
10+
11+
const fn bar() {
12+
foo();
13+
}
14+
15+
fn main() {
16+
bar();
17+
}

0 commit comments

Comments
 (0)