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/pre-init-args.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/pre-init-args.rs')
-rw-r--r-- | cortex-m-rt/tests/compile-fail/pre-init-args.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cortex-m-rt/tests/compile-fail/pre-init-args.rs b/cortex-m-rt/tests/compile-fail/pre-init-args.rs index 94d87bd..9732589 100644 --- a/cortex-m-rt/tests/compile-fail/pre-init-args.rs +++ b/cortex-m-rt/tests/compile-fail/pre-init-args.rs @@ -6,8 +6,7 @@ extern crate panic_halt; use cortex_m_rt::{entry, pre_init}; -#[pre_init(foo)] //~ ERROR custom attribute panicked -//~^ HELP `pre_init` attribute must have no arguments +#[pre_init(foo)] //~ ERROR This attribute accepts no arguments unsafe fn foo() {} #[entry] |