diff options
author | 2018-10-26 21:01:32 +0000 | |
---|---|---|
committer | 2018-10-26 21:01:32 +0000 | |
commit | f7ab39c983d729d56f5a0d4101e111d5d9fe004f (patch) | |
tree | 9223d3239ab82ca2e0cd3ed1eaa3560967406171 /cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs | |
parent | 3d4361409a94774c960e4c95007a8740d558506b (diff) | |
parent | 5baf35a9942621ec38e06ebd98574778e41451bd (diff) | |
download | cortex-m-f7ab39c983d729d56f5a0d4101e111d5d9fe004f.tar.gz cortex-m-f7ab39c983d729d56f5a0d4101e111d5d9fe004f.tar.zst cortex-m-f7ab39c983d729d56f5a0d4101e111d5d9fe004f.zip |
Merge #142
142: attributes: turn panics into compile errors r=therealprof a=japaric
Sample error messages:
```
error: `#[entry]` function must have signature `[unsafe] fn() -> !`
--> examples/error.rs:15:1
|
15 | fn main() {
| ^^
error: aborting due to previous error
```
```
error: This attribute accepts no arguments
--> examples/error.rs:14:1
|
14 | #[entry(hello)]
| ^^^^^^^^^^^^^^^
error: aborting due to previous error
```
```
error: This is not a valid exception name
--> examples/error.rs:20:4
|
20 | fn foo() {}
| ^^^
error: aborting due to previous error
```
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Diffstat (limited to 'cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs')
-rw-r--r-- | cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs index c2e9c31..d3b4392 100644 --- a/cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs +++ b/cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs @@ -11,8 +11,8 @@ fn foo() -> ! { loop {} } -#[exception] //~ ERROR custom attribute panicked -//~^ HELP `HardFault` exception must have signature `[unsafe] fn(&ExceptionFrame) -> !` +#[exception] fn HardFault(_ef: &ExceptionFrame, undef: u32) -> ! { + //~^ ERROR `HardFault` handler must have signature `[unsafe] fn(&ExceptionFrame) -> !` loop {} } |