diff options
| author | Jorge Aparicio <jorge@japaric.io> | 2017-07-04 11:26:11 -0500 |
|---|---|---|
| committer | Jorge Aparicio <jorge@japaric.io> | 2017-07-04 11:26:11 -0500 |
| commit | 86a360a3964ecb04a37c0424c76d7b43a9fd40fe (patch) | |
| tree | cbf0ebee17a588f8f004bdd27e590ee6c958761b /macros/src/check.rs | |
| parent | 2bf5401439df4494b33ef87201ee013eb1f167e8 (diff) | |
rtfm! macro take 2
Diffstat (limited to 'macros/src/check.rs')
| -rw-r--r-- | macros/src/check.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/macros/src/check.rs b/macros/src/check.rs new file mode 100644 index 0000000..ddd9abc --- /dev/null +++ b/macros/src/check.rs @@ -0,0 +1,17 @@ +use syntax::Resources; +use util::{Ceiling, Ceilings}; + +pub fn resources(resources: &Resources, ceilings: &Ceilings) { + for resource in resources.keys() { + if let Some(ceiling) = ceilings.get(&resource) { + assert_ne!( + *ceiling, + Ceiling::Owned, + "{} should be local data", + resource + ); + } else { + panic!("resource {} is unused", resource) + } + } +} |
