aboutsummaryrefslogtreecommitdiff
path: root/macros/src/syntax.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2019-04-16 23:04:24 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2019-04-16 23:04:24 +0200
commitaa7eec02996aca9304187f36d674d5fe898aece6 (patch)
treea6b0769f5b7b92c3d79f1b8b5b788bba0fe46fc3 /macros/src/syntax.rs
parent8da925647ea1ce47e876526d0bd3d918e782d578 (diff)
downloadrtic-aa7eec02996aca9304187f36d674d5fe898aece6.tar.gz
rtic-aa7eec02996aca9304187f36d674d5fe898aece6.tar.zst
rtic-aa7eec02996aca9304187f36d674d5fe898aece6.zip
check task priority at compile time
before we were checking the priority at runtime. The compile time error message when the priority is too high is kind of awful though.
Diffstat (limited to 'macros/src/syntax.rs')
-rw-r--r--macros/src/syntax.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/macros/src/syntax.rs b/macros/src/syntax.rs
index 7f87f633..228d9588 100644
--- a/macros/src/syntax.rs
+++ b/macros/src/syntax.rs
@@ -1039,10 +1039,10 @@ fn parse_args(
}
let value = lit.value();
- if value > u64::from(u8::MAX) {
+ if value > u64::from(u8::MAX) || value == 0 {
return Err(parse::Error::new(
lit.span(),
- "this literal must be in the range 0...255",
+ "this literal must be in the range 1...255",
));
}