Skip to content

Commit 5baf35a

Browse files
committed
update error messages in compile-fail tests
1 parent adf4936 commit 5baf35a

16 files changed

+28
-32
lines changed

cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ fn foo() -> ! {
1111
loop {}
1212
}
1313

14-
#[exception] //~ ERROR custom attribute panicked
15-
//~^ HELP `DefaultHandler` exception must have signature `[unsafe] fn(i16) [-> !]`
14+
#[exception]
1615
fn DefaultHandler(_irqn: i16, undef: u32) {}
16+
//~^ ERROR `DefaultHandler` must have signature `[unsafe] fn(i16) [-> !]`

cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ fn foo() -> ! {
1111
loop {}
1212
}
1313

14-
#[exception] //~ ERROR custom attribute panicked
15-
//~^ HELP `DefaultHandler` exception must have signature `[unsafe] fn(i16) [-> !]`
14+
#[exception]
1615
fn DefaultHandler(_irqn: i16) -> u32 {
16+
//~^ ERROR `DefaultHandler` must have signature `[unsafe] fn(i16) [-> !]`
1717
0
1818
}

cortex-m-rt/tests/compile-fail/entry-args.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ extern crate panic_halt;
66

77
use cortex_m_rt::entry;
88

9-
#[entry(foo)] //~ ERROR custom attribute panicked
10-
//~^ HELP `entry` attribute must have no arguments
9+
#[entry(foo)] //~ ERROR This attribute accepts no arguments
1110
fn foo() -> ! {
1211
loop {}
1312
}

cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ extern crate panic_halt;
66

77
use cortex_m_rt::entry;
88

9-
#[entry] //~ ERROR custom attribute panicked
10-
//~^ HELP `#[entry]` function must have signature `[unsafe] fn() -> !`
9+
#[entry]
1110
fn foo() {}
11+
//~^ ERROR `#[entry]` function must have signature `[unsafe] fn() -> !`

cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ extern crate panic_halt;
66

77
use cortex_m_rt::entry;
88

9-
#[entry] //~ ERROR custom attribute panicked
10-
//~^ HELP `#[entry]` function must have signature `[unsafe] fn() -> !`
9+
#[entry]
1110
fn foo(undef: i32) -> ! {}
11+
//~^ ERROR `#[entry]` function must have signature `[unsafe] fn() -> !`

cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ extern crate panic_halt;
66

77
use cortex_m_rt::entry;
88

9-
#[entry] //~ ERROR custom attribute panicked
10-
//~^ HELP `#[entry]` function must have signature `[unsafe] fn() -> !`
9+
#[entry]
1110
extern "C" fn foo() -> ! {
11+
//~^ ERROR `#[entry]` function must have signature `[unsafe] fn() -> !`
1212
loop {}
1313
}

cortex-m-rt/tests/compile-fail/exception-args.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ fn foo() -> ! {
1111
loop {}
1212
}
1313

14-
#[exception(SysTick)] //~ ERROR custom attribute panicked
15-
//~^ HELP `exception` attribute must have no arguments
14+
#[exception(SysTick)] //~ ERROR This attribute accepts no arguments
1615
fn SysTick() {}

cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ fn foo() -> ! {
1111
loop {}
1212
}
1313

14-
#[exception] //~ ERROR custom attribute panicked
15-
//~^ HELP `#[exception]` functions other than `DefaultHandler` and `HardFault` must have signature `[unsafe] fn() [-> !]`
14+
#[exception]
1615
fn SysTick(undef: u32) {}
16+
//~^ ERROR `#[exception]` handlers other than `DefaultHandler` and `HardFault` must have signature `[unsafe] fn() [-> !]`

cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ fn foo() -> ! {
1111
loop {}
1212
}
1313

14-
#[exception] //~ ERROR custom attribute panicked
15-
//~^ HELP `#[exception]` functions other than `DefaultHandler` and `HardFault` must have signature `[unsafe] fn() [-> !]`
14+
#[exception]
1615
fn SysTick() -> u32 {
16+
//~^ ERROR `#[exception]` handlers other than `DefaultHandler` and `HardFault` must have signature `[unsafe] fn() [-> !]`
1717
0
1818
}

cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ fn foo() -> ! {
1111
loop {}
1212
}
1313

14-
#[exception] //~ ERROR custom attribute panicked
15-
//~^ HELP `HardFault` exception must have signature `[unsafe] fn(&ExceptionFrame) -> !`
14+
#[exception]
1615
fn HardFault(_ef: &ExceptionFrame, undef: u32) -> ! {
16+
//~^ ERROR `HardFault` handler must have signature `[unsafe] fn(&ExceptionFrame) -> !`
1717
loop {}
1818
}

cortex-m-rt/tests/compile-fail/interrupt-args.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ enum interrupt {
1515
USART1,
1616
}
1717

18-
#[interrupt(true)] //~ ERROR custom attribute panicked
19-
//~^ HELP `interrupt` attribute must have no arguments
18+
#[interrupt(true)] //~ ERROR This attribute accepts no arguments
2019
fn USART1() {}

cortex-m-rt/tests/compile-fail/interrupt-bad-signature-1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ enum interrupt {
1515
USART1,
1616
}
1717

18-
#[interrupt] //~ ERROR custom attribute panicked
19-
//~^ HELP `#[interrupt]` functions must have signature `[unsafe] fn() [-> !]`
18+
#[interrupt]
2019
fn USART1(undef: i32) {}
20+
//~^ ERROR `#[interrupt]` handlers must have signature `[unsafe] fn() [-> !]`

cortex-m-rt/tests/compile-fail/interrupt-bad-signature-2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ enum interrupt {
1515
USART1,
1616
}
1717

18-
#[interrupt] //~ ERROR custom attribute panicked
19-
//~^ HELP `#[interrupt]` functions must have signature `[unsafe] fn() [-> !]`
18+
#[interrupt]
2019
fn USART1() -> i32 {
20+
//~^ ERROR `#[interrupt]` handlers must have signature `[unsafe] fn() [-> !]`
2121
0
2222
}

cortex-m-rt/tests/compile-fail/pre-init-args.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ extern crate panic_halt;
66

77
use cortex_m_rt::{entry, pre_init};
88

9-
#[pre_init(foo)] //~ ERROR custom attribute panicked
10-
//~^ HELP `pre_init` attribute must have no arguments
9+
#[pre_init(foo)] //~ ERROR This attribute accepts no arguments
1110
unsafe fn foo() {}
1211

1312
#[entry]

cortex-m-rt/tests/compile-fail/pre-init-bad-signature-1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ extern crate panic_halt;
66

77
use cortex_m_rt::{entry, pre_init};
88

9-
#[pre_init] //~ ERROR custom attribute panicked
10-
//~^ HELP `#[pre_init]` function must have signature `unsafe fn()`
9+
#[pre_init]
1110
fn foo() {}
11+
//~^ ERROR `#[pre_init]` function must have signature `unsafe fn()`
1212

1313
#[entry]
1414
fn bar() -> ! {

cortex-m-rt/tests/compile-fail/pre-init-bad-signature-2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ extern crate panic_halt;
66

77
use cortex_m_rt::{entry, pre_init};
88

9-
#[pre_init] //~ ERROR custom attribute panicked
10-
//~^ HELP `#[pre_init]` function must have signature `unsafe fn()`
9+
#[pre_init]
1110
unsafe fn foo(undef: i32) {}
11+
//~^ ERROR `#[pre_init]` function must have signature `unsafe fn()`
1212

1313
#[entry]
1414
fn bar() -> ! {

0 commit comments

Comments
 (0)