diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2024-07-10 12:44:23 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2024-07-10 12:44:23 +0200 |
| commit | c92f054085a44393329f19cd9cf7dd12d03d80e8 (patch) | |
| tree | e18e07192168634da495a02ae76a98ea3b530b2d /tests/run/array.rs | |
| parent | 5b91a1a6c2e239b635295682ecba8c0d0346ca52 (diff) | |
Merge commit '98ed962c7d3eebe12c97588e61245273d265e72f' into master
Diffstat (limited to 'tests/run/array.rs')
| -rw-r--r-- | tests/run/array.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/run/array.rs b/tests/run/array.rs index afd0eed8200..3fe8917c9a3 100644 --- a/tests/run/array.rs +++ b/tests/run/array.rs @@ -205,6 +205,17 @@ impl Sub for i16 { } } +#[track_caller] +#[lang = "panic_const_add_overflow"] +pub fn panic_const_add_overflow() -> ! { + panic("attempt to add with overflow"); +} + +#[track_caller] +#[lang = "panic_const_sub_overflow"] +pub fn panic_const_sub_overflow() -> ! { + panic("attempt to subtract with overflow"); +} /* * Code |
