From 1a49d67490e3c1b9cb640d459890f4c880a52096 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 31 Aug 2021 19:50:50 +0200 Subject: [PATCH 1/4] validate unused dispatchers closes #521 --- macros/src/codegen/pre_init.rs | 11 +++++++---- ui/unknown-interrupt.rs | 15 +++++++++++++++ ui/unknown-interrupt.stderr | 5 +++++ 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 ui/unknown-interrupt.rs create mode 100644 ui/unknown-interrupt.stderr diff --git a/macros/src/codegen/pre_init.rs b/macros/src/codegen/pre_init.rs index d3c4f54d9e..626d17a0a6 100644 --- a/macros/src/codegen/pre_init.rs +++ b/macros/src/codegen/pre_init.rs @@ -31,6 +31,13 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec Vec Vec (Shared, Local, init::Monotonics) { + (Shared {}, Local {}, init::Monotonics()) + } +} diff --git a/ui/unknown-interrupt.stderr b/ui/unknown-interrupt.stderr new file mode 100644 index 0000000000..d22310223f --- /dev/null +++ b/ui/unknown-interrupt.stderr @@ -0,0 +1,5 @@ +error[E0599]: no variant or associated item named `UnknownInterrupt` found for enum `Interrupt` in the current scope + --> examples/unknown-interrupt.rs:3:47 + | +3 | #[rtic::app(device = lm3s6965, dispatchers = [UnknownInterrupt])] + | ^^^^^^^^^^^^^^^^ variant or associated item not found in `Interrupt` \ No newline at end of file From 38bd29779eac57e6ad7961cd57702434a348e74c Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 31 Aug 2021 19:53:55 +0200 Subject: [PATCH 2/4] style fix --- macros/src/codegen/pre_init.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/src/codegen/pre_init.rs b/macros/src/codegen/pre_init.rs index 626d17a0a6..69f16fe376 100644 --- a/macros/src/codegen/pre_init.rs +++ b/macros/src/codegen/pre_init.rs @@ -32,7 +32,7 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec Date: Tue, 31 Aug 2021 19:54:48 +0200 Subject: [PATCH 3/4] fix UI test --- ui/unknown-interrupt.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/unknown-interrupt.stderr b/ui/unknown-interrupt.stderr index d22310223f..efda28797f 100644 --- a/ui/unknown-interrupt.stderr +++ b/ui/unknown-interrupt.stderr @@ -1,5 +1,5 @@ error[E0599]: no variant or associated item named `UnknownInterrupt` found for enum `Interrupt` in the current scope - --> examples/unknown-interrupt.rs:3:47 + --> $DIR/unknown-interrupt.rs:3:47 | 3 | #[rtic::app(device = lm3s6965, dispatchers = [UnknownInterrupt])] | ^^^^^^^^^^^^^^^^ variant or associated item not found in `Interrupt` \ No newline at end of file From da1fd6166e893482f99f16714a1c718b445c9579 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 31 Aug 2021 20:01:10 +0200 Subject: [PATCH 4/4] fix UI test, take 2 --- ui/unknown-interrupt.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/unknown-interrupt.stderr b/ui/unknown-interrupt.stderr index efda28797f..c7d32699dc 100644 --- a/ui/unknown-interrupt.stderr +++ b/ui/unknown-interrupt.stderr @@ -2,4 +2,4 @@ error[E0599]: no variant or associated item named `UnknownInterrupt` found for e --> $DIR/unknown-interrupt.rs:3:47 | 3 | #[rtic::app(device = lm3s6965, dispatchers = [UnknownInterrupt])] - | ^^^^^^^^^^^^^^^^ variant or associated item not found in `Interrupt` \ No newline at end of file + | ^^^^^^^^^^^^^^^^ variant or associated item not found in `Interrupt`