From bc526b8d74cb548c9da8d5c10d6013008e164ba5 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 6 Sep 2018 01:04:39 +0200 Subject: add compile-fail tests for passing arguments to the attributes --- cortex-m-rt/tests/compile-fail/exception-args.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 cortex-m-rt/tests/compile-fail/exception-args.rs (limited to 'cortex-m-rt/tests/compile-fail/exception-args.rs') diff --git a/cortex-m-rt/tests/compile-fail/exception-args.rs b/cortex-m-rt/tests/compile-fail/exception-args.rs new file mode 100644 index 0000000..85613ff --- /dev/null +++ b/cortex-m-rt/tests/compile-fail/exception-args.rs @@ -0,0 +1,16 @@ +#![no_main] +#![no_std] + +extern crate cortex_m_rt; +extern crate panic_semihosting; + +use cortex_m_rt::{entry, exception}; + +#[entry] +fn foo() -> ! { + loop {} +} + +#[exception(SysTick)] //~ ERROR custom attribute panicked +//~^ HELP `exception` attribute must have no arguments +fn SysTick() {} -- cgit v1.2.3 From 85ba898dc80d14dc35dd21abab7684bb1ea0f4c8 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Mon, 17 Sep 2018 23:38:18 +0200 Subject: use panic-halt instead of panic-{abort,semihosting} the former requires a feature gate; the later pulls in the cortex-m crate --- cortex-m-rt/Cargo.toml | 3 +-- cortex-m-rt/examples/alignment.rs | 2 +- cortex-m-rt/examples/data_overflow.rs | 2 +- cortex-m-rt/examples/device.rs | 2 +- cortex-m-rt/examples/divergent-default-handler.rs | 2 +- cortex-m-rt/examples/divergent-exception.rs | 2 +- cortex-m-rt/examples/entry-static.rs | 2 +- cortex-m-rt/examples/main.rs | 2 +- cortex-m-rt/examples/minimal.rs | 2 +- cortex-m-rt/examples/override-exception.rs | 2 +- cortex-m-rt/examples/pre_init.rs | 2 +- cortex-m-rt/examples/rand.rs | 2 +- cortex-m-rt/examples/state.rs | 2 +- cortex-m-rt/examples/unsafe-default-handler.rs | 2 +- cortex-m-rt/examples/unsafe-entry.rs | 2 +- cortex-m-rt/examples/unsafe-exception.rs | 2 +- cortex-m-rt/examples/unsafe-hard-fault.rs | 2 +- cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs | 2 +- cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs | 2 +- cortex-m-rt/tests/compile-fail/default-handler-hidden.rs | 2 +- cortex-m-rt/tests/compile-fail/default-handler-twice.rs | 2 +- cortex-m-rt/tests/compile-fail/entry-args.rs | 2 +- cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs | 2 +- cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs | 2 +- cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs | 2 +- cortex-m-rt/tests/compile-fail/entry-hidden.rs | 2 +- cortex-m-rt/tests/compile-fail/entry-soundness.rs | 2 +- cortex-m-rt/tests/compile-fail/entry-twice.rs | 2 +- cortex-m-rt/tests/compile-fail/exception-args.rs | 2 +- cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs | 2 +- cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs | 2 +- cortex-m-rt/tests/compile-fail/exception-hidden.rs | 2 +- cortex-m-rt/tests/compile-fail/exception-soundness.rs | 2 +- cortex-m-rt/tests/compile-fail/exception-twice.rs | 2 +- cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs | 2 +- cortex-m-rt/tests/compile-fail/hard-fault-hidden.rs | 2 +- cortex-m-rt/tests/compile-fail/hard-fault-twice.rs | 2 +- cortex-m-rt/tests/compile-fail/pre-init-args.rs | 2 +- cortex-m-rt/tests/compile-fail/pre-init-bad-signature-1.rs | 2 +- cortex-m-rt/tests/compile-fail/pre-init-bad-signature-2.rs | 2 +- cortex-m-rt/tests/compile-fail/pre-init-hidden.rs | 2 +- cortex-m-rt/tests/compile-fail/pre-init-twice.rs | 2 +- 42 files changed, 42 insertions(+), 43 deletions(-) (limited to 'cortex-m-rt/tests/compile-fail/exception-args.rs') diff --git a/cortex-m-rt/Cargo.toml b/cortex-m-rt/Cargo.toml index 41a958d..ae72260 100644 --- a/cortex-m-rt/Cargo.toml +++ b/cortex-m-rt/Cargo.toml @@ -16,8 +16,7 @@ cortex-m-rt-macros = { path = "macros", version = "0.1.1" } [dev-dependencies] cortex-m = "0.5.4" -panic-abort = "0.3.0" -panic-semihosting = "0.4.0" +panic-halt = "0.2.0" [dev-dependencies.rand] default-features = false diff --git a/cortex-m-rt/examples/alignment.rs b/cortex-m-rt/examples/alignment.rs index 25d755d..4421e69 100644 --- a/cortex-m-rt/examples/alignment.rs +++ b/cortex-m-rt/examples/alignment.rs @@ -5,7 +5,7 @@ #![no_std] extern crate cortex_m_rt as rt; -extern crate panic_abort; +extern crate panic_halt; use core::ptr; diff --git a/cortex-m-rt/examples/data_overflow.rs b/cortex-m-rt/examples/data_overflow.rs index ceec18b..ea48b23 100644 --- a/cortex-m-rt/examples/data_overflow.rs +++ b/cortex-m-rt/examples/data_overflow.rs @@ -6,7 +6,7 @@ #![no_std] extern crate cortex_m_rt as rt; -extern crate panic_abort; +extern crate panic_halt; use core::ptr; diff --git a/cortex-m-rt/examples/device.rs b/cortex-m-rt/examples/device.rs index 950a564..dc1c738 100644 --- a/cortex-m-rt/examples/device.rs +++ b/cortex-m-rt/examples/device.rs @@ -6,7 +6,7 @@ #![no_std] extern crate cortex_m_rt as rt; -extern crate panic_semihosting; +extern crate panic_halt; use rt::entry; diff --git a/cortex-m-rt/examples/divergent-default-handler.rs b/cortex-m-rt/examples/divergent-default-handler.rs index cbb8bb1..22fa437 100644 --- a/cortex-m-rt/examples/divergent-default-handler.rs +++ b/cortex-m-rt/examples/divergent-default-handler.rs @@ -4,7 +4,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; diff --git a/cortex-m-rt/examples/divergent-exception.rs b/cortex-m-rt/examples/divergent-exception.rs index 9998884..cb2247b 100644 --- a/cortex-m-rt/examples/divergent-exception.rs +++ b/cortex-m-rt/examples/divergent-exception.rs @@ -3,7 +3,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; diff --git a/cortex-m-rt/examples/entry-static.rs b/cortex-m-rt/examples/entry-static.rs index 1b2e118..55e7a89 100644 --- a/cortex-m-rt/examples/entry-static.rs +++ b/cortex-m-rt/examples/entry-static.rs @@ -6,7 +6,7 @@ #![no_std] extern crate cortex_m_rt as rt; -extern crate panic_semihosting; +extern crate panic_halt; use rt::entry; diff --git a/cortex-m-rt/examples/main.rs b/cortex-m-rt/examples/main.rs index e5ce3d1..b8ab66e 100644 --- a/cortex-m-rt/examples/main.rs +++ b/cortex-m-rt/examples/main.rs @@ -5,7 +5,7 @@ #![no_std] extern crate cortex_m_rt as rt; -extern crate panic_semihosting; +extern crate panic_halt; #[no_mangle] pub unsafe extern "C" fn main() -> ! { diff --git a/cortex-m-rt/examples/minimal.rs b/cortex-m-rt/examples/minimal.rs index 6f60180..bd0a6ad 100644 --- a/cortex-m-rt/examples/minimal.rs +++ b/cortex-m-rt/examples/minimal.rs @@ -6,7 +6,7 @@ #![no_std] extern crate cortex_m_rt as rt; -extern crate panic_semihosting; +extern crate panic_halt; use rt::entry; diff --git a/cortex-m-rt/examples/override-exception.rs b/cortex-m-rt/examples/override-exception.rs index 3e0af25..6da6c5e 100644 --- a/cortex-m-rt/examples/override-exception.rs +++ b/cortex-m-rt/examples/override-exception.rs @@ -7,7 +7,7 @@ extern crate cortex_m; extern crate cortex_m_rt as rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m::asm; use rt::{entry, exception, ExceptionFrame}; diff --git a/cortex-m-rt/examples/pre_init.rs b/cortex-m-rt/examples/pre_init.rs index 00e2f2c..2c931bb 100644 --- a/cortex-m-rt/examples/pre_init.rs +++ b/cortex-m-rt/examples/pre_init.rs @@ -5,7 +5,7 @@ #![no_std] extern crate cortex_m_rt as rt; -extern crate panic_semihosting; +extern crate panic_halt; use rt::{entry, pre_init}; diff --git a/cortex-m-rt/examples/rand.rs b/cortex-m-rt/examples/rand.rs index e0cfd31..ec3afaa 100644 --- a/cortex-m-rt/examples/rand.rs +++ b/cortex-m-rt/examples/rand.rs @@ -7,7 +7,7 @@ extern crate cortex_m_rt as rt; use rt::entry; -extern crate panic_semihosting; +extern crate panic_halt; extern crate rand; use rand::Rng; diff --git a/cortex-m-rt/examples/state.rs b/cortex-m-rt/examples/state.rs index 573914f..ee6224d 100644 --- a/cortex-m-rt/examples/state.rs +++ b/cortex-m-rt/examples/state.rs @@ -6,7 +6,7 @@ #![no_std] extern crate cortex_m_rt as rt; -extern crate panic_semihosting; +extern crate panic_halt; use rt::{entry, exception}; diff --git a/cortex-m-rt/examples/unsafe-default-handler.rs b/cortex-m-rt/examples/unsafe-default-handler.rs index 48bd31e..a805c12 100644 --- a/cortex-m-rt/examples/unsafe-default-handler.rs +++ b/cortex-m-rt/examples/unsafe-default-handler.rs @@ -3,7 +3,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; diff --git a/cortex-m-rt/examples/unsafe-entry.rs b/cortex-m-rt/examples/unsafe-entry.rs index feb6f44..9dcbf33 100644 --- a/cortex-m-rt/examples/unsafe-entry.rs +++ b/cortex-m-rt/examples/unsafe-entry.rs @@ -3,7 +3,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::entry; diff --git a/cortex-m-rt/examples/unsafe-exception.rs b/cortex-m-rt/examples/unsafe-exception.rs index d67f06f..4212610 100644 --- a/cortex-m-rt/examples/unsafe-exception.rs +++ b/cortex-m-rt/examples/unsafe-exception.rs @@ -3,7 +3,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; diff --git a/cortex-m-rt/examples/unsafe-hard-fault.rs b/cortex-m-rt/examples/unsafe-hard-fault.rs index b091d47..b1d48f3 100644 --- a/cortex-m-rt/examples/unsafe-hard-fault.rs +++ b/cortex-m-rt/examples/unsafe-hard-fault.rs @@ -3,7 +3,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception, ExceptionFrame}; diff --git a/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs index 037e9c8..72ea0fa 100644 --- a/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs +++ b/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; diff --git a/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs b/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs index 8fc4a7e..2e46a6b 100644 --- a/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs +++ b/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; diff --git a/cortex-m-rt/tests/compile-fail/default-handler-hidden.rs b/cortex-m-rt/tests/compile-fail/default-handler-hidden.rs index 059c10b..e57cb31 100644 --- a/cortex-m-rt/tests/compile-fail/default-handler-hidden.rs +++ b/cortex-m-rt/tests/compile-fail/default-handler-hidden.rs @@ -5,7 +5,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; diff --git a/cortex-m-rt/tests/compile-fail/default-handler-twice.rs b/cortex-m-rt/tests/compile-fail/default-handler-twice.rs index 7d6ad98..ad1c3f9 100644 --- a/cortex-m-rt/tests/compile-fail/default-handler-twice.rs +++ b/cortex-m-rt/tests/compile-fail/default-handler-twice.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; diff --git a/cortex-m-rt/tests/compile-fail/entry-args.rs b/cortex-m-rt/tests/compile-fail/entry-args.rs index 07cb4bd..b0d293c 100644 --- a/cortex-m-rt/tests/compile-fail/entry-args.rs +++ b/cortex-m-rt/tests/compile-fail/entry-args.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::entry; diff --git a/cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs index 5eeb49f..5fe9a1a 100644 --- a/cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs +++ b/cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::entry; diff --git a/cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs b/cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs index 18bbaed..2b71a57 100644 --- a/cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs +++ b/cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::entry; diff --git a/cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs b/cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs index 09b75e9..463e5b7 100644 --- a/cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs +++ b/cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::entry; diff --git a/cortex-m-rt/tests/compile-fail/entry-hidden.rs b/cortex-m-rt/tests/compile-fail/entry-hidden.rs index 7d74063..836db0d 100644 --- a/cortex-m-rt/tests/compile-fail/entry-hidden.rs +++ b/cortex-m-rt/tests/compile-fail/entry-hidden.rs @@ -5,7 +5,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; mod hidden { use cortex_m_rt::entry; diff --git a/cortex-m-rt/tests/compile-fail/entry-soundness.rs b/cortex-m-rt/tests/compile-fail/entry-soundness.rs index 5e40a8f..9fc8ec1 100644 --- a/cortex-m-rt/tests/compile-fail/entry-soundness.rs +++ b/cortex-m-rt/tests/compile-fail/entry-soundness.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; diff --git a/cortex-m-rt/tests/compile-fail/entry-twice.rs b/cortex-m-rt/tests/compile-fail/entry-twice.rs index b2819f6..757083a 100644 --- a/cortex-m-rt/tests/compile-fail/entry-twice.rs +++ b/cortex-m-rt/tests/compile-fail/entry-twice.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::entry; diff --git a/cortex-m-rt/tests/compile-fail/exception-args.rs b/cortex-m-rt/tests/compile-fail/exception-args.rs index 85613ff..472a583 100644 --- a/cortex-m-rt/tests/compile-fail/exception-args.rs +++ b/cortex-m-rt/tests/compile-fail/exception-args.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; diff --git a/cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs index 966493e..e1fbf31 100644 --- a/cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs +++ b/cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; diff --git a/cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs b/cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs index 8504771..ed46cf6 100644 --- a/cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs +++ b/cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; diff --git a/cortex-m-rt/tests/compile-fail/exception-hidden.rs b/cortex-m-rt/tests/compile-fail/exception-hidden.rs index 053c81c..6f57089 100644 --- a/cortex-m-rt/tests/compile-fail/exception-hidden.rs +++ b/cortex-m-rt/tests/compile-fail/exception-hidden.rs @@ -5,7 +5,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; diff --git a/cortex-m-rt/tests/compile-fail/exception-soundness.rs b/cortex-m-rt/tests/compile-fail/exception-soundness.rs index 07d73fa..aae2476 100644 --- a/cortex-m-rt/tests/compile-fail/exception-soundness.rs +++ b/cortex-m-rt/tests/compile-fail/exception-soundness.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; diff --git a/cortex-m-rt/tests/compile-fail/exception-twice.rs b/cortex-m-rt/tests/compile-fail/exception-twice.rs index 5377fce..aabbe5a 100644 --- a/cortex-m-rt/tests/compile-fail/exception-twice.rs +++ b/cortex-m-rt/tests/compile-fail/exception-twice.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception}; 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 83fda5f..c2e9c31 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 @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception, ExceptionFrame}; diff --git a/cortex-m-rt/tests/compile-fail/hard-fault-hidden.rs b/cortex-m-rt/tests/compile-fail/hard-fault-hidden.rs index 31237c4..956310b 100644 --- a/cortex-m-rt/tests/compile-fail/hard-fault-hidden.rs +++ b/cortex-m-rt/tests/compile-fail/hard-fault-hidden.rs @@ -5,7 +5,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception, ExceptionFrame}; diff --git a/cortex-m-rt/tests/compile-fail/hard-fault-twice.rs b/cortex-m-rt/tests/compile-fail/hard-fault-twice.rs index 90270e5..0bb6c8c 100644 --- a/cortex-m-rt/tests/compile-fail/hard-fault-twice.rs +++ b/cortex-m-rt/tests/compile-fail/hard-fault-twice.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, exception, ExceptionFrame}; 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 716b211..94d87bd 100644 --- a/cortex-m-rt/tests/compile-fail/pre-init-args.rs +++ b/cortex-m-rt/tests/compile-fail/pre-init-args.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, pre_init}; diff --git a/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-1.rs index 58d3022..249f477 100644 --- a/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-1.rs +++ b/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-1.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, pre_init}; diff --git a/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-2.rs b/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-2.rs index e47ed59..e942542 100644 --- a/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-2.rs +++ b/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-2.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, pre_init}; diff --git a/cortex-m-rt/tests/compile-fail/pre-init-hidden.rs b/cortex-m-rt/tests/compile-fail/pre-init-hidden.rs index f512d62..63ab90b 100644 --- a/cortex-m-rt/tests/compile-fail/pre-init-hidden.rs +++ b/cortex-m-rt/tests/compile-fail/pre-init-hidden.rs @@ -5,7 +5,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; mod hidden { use cortex_m_rt::pre_init; diff --git a/cortex-m-rt/tests/compile-fail/pre-init-twice.rs b/cortex-m-rt/tests/compile-fail/pre-init-twice.rs index 5fb1ade..74a3f6b 100644 --- a/cortex-m-rt/tests/compile-fail/pre-init-twice.rs +++ b/cortex-m-rt/tests/compile-fail/pre-init-twice.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rt; -extern crate panic_semihosting; +extern crate panic_halt; use cortex_m_rt::{entry, pre_init}; -- cgit v1.2.3 From 5baf35a9942621ec38e06ebd98574778e41451bd Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Fri, 26 Oct 2018 22:09:00 +0200 Subject: update error messages in compile-fail tests --- cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs | 4 ++-- cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs | 4 ++-- cortex-m-rt/tests/compile-fail/entry-args.rs | 3 +-- cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs | 4 ++-- cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs | 4 ++-- cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs | 4 ++-- cortex-m-rt/tests/compile-fail/exception-args.rs | 3 +-- cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs | 4 ++-- cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs | 4 ++-- cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs | 4 ++-- cortex-m-rt/tests/compile-fail/interrupt-args.rs | 3 +-- cortex-m-rt/tests/compile-fail/interrupt-bad-signature-1.rs | 4 ++-- cortex-m-rt/tests/compile-fail/interrupt-bad-signature-2.rs | 4 ++-- cortex-m-rt/tests/compile-fail/pre-init-args.rs | 3 +-- cortex-m-rt/tests/compile-fail/pre-init-bad-signature-1.rs | 4 ++-- cortex-m-rt/tests/compile-fail/pre-init-bad-signature-2.rs | 4 ++-- 16 files changed, 28 insertions(+), 32 deletions(-) (limited to 'cortex-m-rt/tests/compile-fail/exception-args.rs') diff --git a/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs index 72ea0fa..5436115 100644 --- a/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs +++ b/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs @@ -11,6 +11,6 @@ fn foo() -> ! { loop {} } -#[exception] //~ ERROR custom attribute panicked -//~^ HELP `DefaultHandler` exception must have signature `[unsafe] fn(i16) [-> !]` +#[exception] fn DefaultHandler(_irqn: i16, undef: u32) {} +//~^ ERROR `DefaultHandler` must have signature `[unsafe] fn(i16) [-> !]` diff --git a/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs b/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs index 2e46a6b..1cca10c 100644 --- a/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs +++ b/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs @@ -11,8 +11,8 @@ fn foo() -> ! { loop {} } -#[exception] //~ ERROR custom attribute panicked -//~^ HELP `DefaultHandler` exception must have signature `[unsafe] fn(i16) [-> !]` +#[exception] fn DefaultHandler(_irqn: i16) -> u32 { + //~^ ERROR `DefaultHandler` must have signature `[unsafe] fn(i16) [-> !]` 0 } diff --git a/cortex-m-rt/tests/compile-fail/entry-args.rs b/cortex-m-rt/tests/compile-fail/entry-args.rs index b0d293c..5f0b837 100644 --- a/cortex-m-rt/tests/compile-fail/entry-args.rs +++ b/cortex-m-rt/tests/compile-fail/entry-args.rs @@ -6,8 +6,7 @@ extern crate panic_halt; use cortex_m_rt::entry; -#[entry(foo)] //~ ERROR custom attribute panicked -//~^ HELP `entry` attribute must have no arguments +#[entry(foo)] //~ ERROR This attribute accepts no arguments fn foo() -> ! { loop {} } diff --git a/cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs index 5fe9a1a..1ed3649 100644 --- a/cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs +++ b/cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs @@ -6,6 +6,6 @@ extern crate panic_halt; use cortex_m_rt::entry; -#[entry] //~ ERROR custom attribute panicked -//~^ HELP `#[entry]` function must have signature `[unsafe] fn() -> !` +#[entry] fn foo() {} +//~^ ERROR `#[entry]` function must have signature `[unsafe] fn() -> !` diff --git a/cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs b/cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs index 2b71a57..359444c 100644 --- a/cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs +++ b/cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs @@ -6,6 +6,6 @@ extern crate panic_halt; use cortex_m_rt::entry; -#[entry] //~ ERROR custom attribute panicked -//~^ HELP `#[entry]` function must have signature `[unsafe] fn() -> !` +#[entry] fn foo(undef: i32) -> ! {} +//~^ ERROR `#[entry]` function must have signature `[unsafe] fn() -> !` diff --git a/cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs b/cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs index 463e5b7..048b0e6 100644 --- a/cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs +++ b/cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs @@ -6,8 +6,8 @@ extern crate panic_halt; use cortex_m_rt::entry; -#[entry] //~ ERROR custom attribute panicked -//~^ HELP `#[entry]` function must have signature `[unsafe] fn() -> !` +#[entry] extern "C" fn foo() -> ! { + //~^ ERROR `#[entry]` function must have signature `[unsafe] fn() -> !` loop {} } diff --git a/cortex-m-rt/tests/compile-fail/exception-args.rs b/cortex-m-rt/tests/compile-fail/exception-args.rs index 472a583..518ac03 100644 --- a/cortex-m-rt/tests/compile-fail/exception-args.rs +++ b/cortex-m-rt/tests/compile-fail/exception-args.rs @@ -11,6 +11,5 @@ fn foo() -> ! { loop {} } -#[exception(SysTick)] //~ ERROR custom attribute panicked -//~^ HELP `exception` attribute must have no arguments +#[exception(SysTick)] //~ ERROR This attribute accepts no arguments fn SysTick() {} diff --git a/cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs index e1fbf31..2a046c3 100644 --- a/cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs +++ b/cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs @@ -11,6 +11,6 @@ fn foo() -> ! { loop {} } -#[exception] //~ ERROR custom attribute panicked -//~^ HELP `#[exception]` functions other than `DefaultHandler` and `HardFault` must have signature `[unsafe] fn() [-> !]` +#[exception] fn SysTick(undef: u32) {} +//~^ ERROR `#[exception]` handlers other than `DefaultHandler` and `HardFault` must have signature `[unsafe] fn() [-> !]` diff --git a/cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs b/cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs index ed46cf6..d2fb210 100644 --- a/cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs +++ b/cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs @@ -11,8 +11,8 @@ fn foo() -> ! { loop {} } -#[exception] //~ ERROR custom attribute panicked -//~^ HELP `#[exception]` functions other than `DefaultHandler` and `HardFault` must have signature `[unsafe] fn() [-> !]` +#[exception] fn SysTick() -> u32 { + //~^ ERROR `#[exception]` handlers other than `DefaultHandler` and `HardFault` must have signature `[unsafe] fn() [-> !]` 0 } 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 {} } diff --git a/cortex-m-rt/tests/compile-fail/interrupt-args.rs b/cortex-m-rt/tests/compile-fail/interrupt-args.rs index 36af388..9630ce1 100644 --- a/cortex-m-rt/tests/compile-fail/interrupt-args.rs +++ b/cortex-m-rt/tests/compile-fail/interrupt-args.rs @@ -15,6 +15,5 @@ enum interrupt { USART1, } -#[interrupt(true)] //~ ERROR custom attribute panicked -//~^ HELP `interrupt` attribute must have no arguments +#[interrupt(true)] //~ ERROR This attribute accepts no arguments fn USART1() {} diff --git a/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-1.rs index 0222413..c7e25b3 100644 --- a/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-1.rs +++ b/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-1.rs @@ -15,6 +15,6 @@ enum interrupt { USART1, } -#[interrupt] //~ ERROR custom attribute panicked -//~^ HELP `#[interrupt]` functions must have signature `[unsafe] fn() [-> !]` +#[interrupt] fn USART1(undef: i32) {} +//~^ ERROR `#[interrupt]` handlers must have signature `[unsafe] fn() [-> !]` diff --git a/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-2.rs b/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-2.rs index 0c9000b..ed5cbd4 100644 --- a/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-2.rs +++ b/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-2.rs @@ -15,8 +15,8 @@ enum interrupt { USART1, } -#[interrupt] //~ ERROR custom attribute panicked -//~^ HELP `#[interrupt]` functions must have signature `[unsafe] fn() [-> !]` +#[interrupt] fn USART1() -> i32 { + //~^ ERROR `#[interrupt]` handlers must have signature `[unsafe] fn() [-> !]` 0 } 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] diff --git a/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-1.rs index 249f477..0c3c476 100644 --- a/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-1.rs +++ b/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-1.rs @@ -6,9 +6,9 @@ extern crate panic_halt; use cortex_m_rt::{entry, pre_init}; -#[pre_init] //~ ERROR custom attribute panicked -//~^ HELP `#[pre_init]` function must have signature `unsafe fn()` +#[pre_init] fn foo() {} +//~^ ERROR `#[pre_init]` function must have signature `unsafe fn()` #[entry] fn bar() -> ! { diff --git a/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-2.rs b/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-2.rs index e942542..f41d032 100644 --- a/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-2.rs +++ b/cortex-m-rt/tests/compile-fail/pre-init-bad-signature-2.rs @@ -6,9 +6,9 @@ extern crate panic_halt; use cortex_m_rt::{entry, pre_init}; -#[pre_init] //~ ERROR custom attribute panicked -//~^ HELP `#[pre_init]` function must have signature `unsafe fn()` +#[pre_init] unsafe fn foo(undef: i32) {} +//~^ ERROR `#[pre_init]` function must have signature `unsafe fn()` #[entry] fn bar() -> ! { -- cgit v1.2.3