Skip to content

Commit 943edfa

Browse files
committed
test that function with wrong return types are rejected
1 parent 19fcb13 commit 943edfa

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#![no_main]
2+
#![no_std]
3+
4+
extern crate cortex_m_rt;
5+
extern crate panic_semihosting;
6+
7+
use cortex_m_rt::{entry, exception};
8+
9+
#[entry]
10+
fn foo() -> ! {
11+
loop {}
12+
}
13+
14+
#[exception] //~ ERROR custom attribute panicked
15+
//~^ HELP `DefaultHandler` exception must have signature `[unsafe] fn(i16) [-> !]`
16+
fn DefaultHandler(_irqn: i16) -> u32 {
17+
0
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#![no_main]
2+
#![no_std]
3+
4+
extern crate cortex_m_rt;
5+
extern crate panic_semihosting;
6+
7+
use cortex_m_rt::{entry, exception};
8+
9+
#[entry]
10+
fn foo() -> ! {
11+
loop {}
12+
}
13+
14+
#[exception] //~ ERROR custom attribute panicked
15+
//~^ HELP `#[exception]` functions other than `DefaultHandler` and `HardFault` must have signature `[unsafe] fn() [-> !]`
16+
fn SysTick() -> u32 {
17+
0
18+
}

0 commit comments

Comments
 (0)